Skip to content

Commit

Permalink
Added PHP version checks.
Browse files Browse the repository at this point in the history
PHP 5.x is not supported.
PHP < 7.3 may work but has known issues and so is not supported.
  • Loading branch information
digininja committed May 7, 2024
1 parent c78a4c5 commit 7caa98d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
$database_type_name = "PostgreSQL";
}

$phpVersionWarning = "";

if (version_compare(phpversion(), '6', '<')) {
$phpVersionWarning = "<span class=\"failure\">Versions of PHP below 7.x are not supported, please upgrade.</span><br /><br />";
} elseif (version_compare(phpversion(), '7.3', '<')) {
$phpVersionWarning = "<span class=\"failure\">Versions of PHP below 7.3 may work but have known problems, please upgrade.</span><br /><br />";
}

$page[ 'body' ] .= "
<div class=\"body_padded\">
<h1>Database Setup <img src=\"" . DVWA_WEB_PAGE_TO_ROOT . "dvwa/images/spanner.png\" /></h1>
Expand All @@ -62,6 +70,7 @@
{$DVWAOS}<br />
<br />
PHP version: <em>" . phpversion() . "</em><br />
{$phpVersionWarning}
{$phpDisplayErrors}<br />
{$phpDisplayStartupErrors}<br />
{$phpURLInclude}<br/ >
Expand Down

0 comments on commit 7caa98d

Please sign in to comment.