From 737ef4dcc25f73daa3200dd7e53ef47161a104db Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Fri, 15 Mar 2013 23:47:53 +0100 Subject: [PATCH 1/3] Compare versions in a more robust way. --- include/sanity_check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sanity_check.php b/include/sanity_check.php index 2a39cfa4..427457d8 100644 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -20,7 +20,7 @@ array_push($errors, "Please don't run this script as root."); } - if (version_compare("5.3.0", phpversion()) == 1) { + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { array_push($errors, "PHP version 5.3.0 or newer required."); } From f2ea6b1696787771adc5859b3e475df8cd65b7ce Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Sat, 16 Mar 2013 00:30:29 +0100 Subject: [PATCH 2/3] Found another place with a php version check. --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index fa868318..4d1ff795 100644 --- a/index.php +++ b/index.php @@ -7,7 +7,7 @@ // we need a separate check here because functions.php might get parsed // incorrectly before 5.3 because of :: syntax. - if (version_compare("5.3.0", phpversion()) == 1) { + if (!(version_compare(PHP_VERSION, '5.3.0', '>='))) { print "Fatal Error: PHP version 5.3.0 or newer required.\n"; exit; } From 9f1d4dc282863cb469a439c59d6cd077e0effa98 Mon Sep 17 00:00:00 2001 From: Dimitar Dimitrov Date: Sat, 16 Mar 2013 01:32:27 +0100 Subject: [PATCH 3/3] Somehow I managed to get it wrong the first time. --- include/sanity_check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sanity_check.php b/include/sanity_check.php index 427457d8..3e883291 100644 --- a/include/sanity_check.php +++ b/include/sanity_check.php @@ -20,7 +20,7 @@ array_push($errors, "Please don't run this script as root."); } - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + if (!(version_compare(PHP_VERSION, '5.3.0', '>='))) { array_push($errors, "PHP version 5.3.0 or newer required."); }