From bf9d63636eaa2c8ac58c8db5dfd03316966a16db Mon Sep 17 00:00:00 2001 From: robocoder <anthon.pang@gmail.com> Date: Sun, 25 Jul 2010 19:47:19 +0000 Subject: [PATCH] PHP_VERSION was introduced in php 5.2.6 git-svn-id: http://dev.piwik.org/svn/trunk@2682 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/SecurityInfo/PhpSecInfo/Test/Application/php.php | 2 +- .../SecurityInfo/PhpSecInfo/Test/Core/allow_url_fopen.php | 6 +++--- .../SecurityInfo/PhpSecInfo/Test/Core/allow_url_include.php | 4 ++-- .../SecurityInfo/PhpSecInfo/Test/Core/magic_quotes_gpc.php | 4 ++-- .../SecurityInfo/PhpSecInfo/Test/Core/register_globals.php | 4 ++-- plugins/SecurityInfo/PhpSecInfo/Test/Curl/file_support.php | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/SecurityInfo/PhpSecInfo/Test/Application/php.php b/plugins/SecurityInfo/PhpSecInfo/Test/Application/php.php index 0d86d309e9..34e4ae27c1 100644 --- a/plugins/SecurityInfo/PhpSecInfo/Test/Application/php.php +++ b/plugins/SecurityInfo/PhpSecInfo/Test/Application/php.php @@ -26,7 +26,7 @@ class PhpSecInfo_Test_Application_Php extends PhpSecInfo_Test_Application var $recommended_value = null; function _retrieveCurrentValue() { - $this->current_value = PHP_VERSION;; + $this->current_value = phpversion();; $url = 'http://php.net/releases/?serialize=1&version=5'; $timeout = Piwik_UpdateCheck::SOCKET_TIMEOUT; diff --git a/plugins/SecurityInfo/PhpSecInfo/Test/Core/allow_url_fopen.php b/plugins/SecurityInfo/PhpSecInfo/Test/Core/allow_url_fopen.php index 799bb88110..10a355bf3b 100644 --- a/plugins/SecurityInfo/PhpSecInfo/Test/Core/allow_url_fopen.php +++ b/plugins/SecurityInfo/PhpSecInfo/Test/Core/allow_url_fopen.php @@ -47,7 +47,7 @@ class PhpSecInfo_Test_Core_Allow_Url_Fopen extends PhpSecInfo_Test_Core * */ function _execTest() { - if ( version_compare(PHP_VERSION, '5.2', '<') ) { /* this is much more severe if we're running < 5.2 */ + if ( version_compare(phpversion(), '5.2', '<') ) { /* this is much more severe if we're running < 5.2 */ if ($this->current_value == $this->recommended_value) { return PHPSECINFO_TEST_RESULT_OK; } @@ -66,7 +66,7 @@ class PhpSecInfo_Test_Core_Allow_Url_Fopen extends PhpSecInfo_Test_Core */ function _setMessages() { parent::_setMessages(); - if ( version_compare(PHP_VERSION, '5.2', '<') ) { /* this is much more severe if we're running < 5.2 */ + if ( version_compare(phpversion(), '5.2', '<') ) { /* this is much more severe if we're running < 5.2 */ $this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', 'allow_url_fopen is disabled, which is the recommended setting'); $this->setMessageForResult(PHPSECINFO_TEST_RESULT_WARN, 'en', 'allow_url_fopen is enabled. This could be a serious security risk. You should disable allow_url_fopen and consider using the <a href="http://php.net/manual/en/ref.curl.php" target="_blank">PHP cURL functions</a> instead.'); @@ -76,4 +76,4 @@ class PhpSecInfo_Test_Core_Allow_Url_Fopen extends PhpSecInfo_Test_Core } -} \ No newline at end of file +} diff --git a/plugins/SecurityInfo/PhpSecInfo/Test/Core/allow_url_include.php b/plugins/SecurityInfo/PhpSecInfo/Test/Core/allow_url_include.php index 59bedcafc1..2086e6facc 100644 --- a/plugins/SecurityInfo/PhpSecInfo/Test/Core/allow_url_include.php +++ b/plugins/SecurityInfo/PhpSecInfo/Test/Core/allow_url_include.php @@ -57,7 +57,7 @@ class PhpSecInfo_Test_Core_Allow_Url_Include extends PhpSecInfo_Test_Core */ function isTestable() { - if ( version_compare(PHP_VERSION, '5.2', '<') ) { + if ( version_compare(phpversion(), '5.2', '<') ) { return false; } else { return true; @@ -79,4 +79,4 @@ class PhpSecInfo_Test_Core_Allow_Url_Include extends PhpSecInfo_Test_Core } -} \ No newline at end of file +} diff --git a/plugins/SecurityInfo/PhpSecInfo/Test/Core/magic_quotes_gpc.php b/plugins/SecurityInfo/PhpSecInfo/Test/Core/magic_quotes_gpc.php index 89a0ff6f0d..ece1861c43 100644 --- a/plugins/SecurityInfo/PhpSecInfo/Test/Core/magic_quotes_gpc.php +++ b/plugins/SecurityInfo/PhpSecInfo/Test/Core/magic_quotes_gpc.php @@ -42,7 +42,7 @@ class PhpSecInfo_Test_Core_Magic_Quotes_GPC extends PhpSecInfo_Test_Core * @return boolean */ function isTestable() { - return version_compare(PHP_VERSION, '6', '<') ; + return version_compare(phpversion(), '6', '<') ; } @@ -77,4 +77,4 @@ class PhpSecInfo_Test_Core_Magic_Quotes_GPC extends PhpSecInfo_Test_Core } -} \ No newline at end of file +} diff --git a/plugins/SecurityInfo/PhpSecInfo/Test/Core/register_globals.php b/plugins/SecurityInfo/PhpSecInfo/Test/Core/register_globals.php index 1caa7e8e30..b6262e6030 100644 --- a/plugins/SecurityInfo/PhpSecInfo/Test/Core/register_globals.php +++ b/plugins/SecurityInfo/PhpSecInfo/Test/Core/register_globals.php @@ -43,7 +43,7 @@ class PhpSecInfo_Test_Core_Register_Globals extends PhpSecInfo_Test_Core * @return boolean */ function isTestable() { - return version_compare(PHP_VERSION, '6', '<') ; + return version_compare(phpversion(), '6', '<') ; } @@ -74,4 +74,4 @@ class PhpSecInfo_Test_Core_Register_Globals extends PhpSecInfo_Test_Core } -} \ No newline at end of file +} diff --git a/plugins/SecurityInfo/PhpSecInfo/Test/Curl/file_support.php b/plugins/SecurityInfo/PhpSecInfo/Test/Curl/file_support.php index 816d747259..e62b9cc07b 100644 --- a/plugins/SecurityInfo/PhpSecInfo/Test/Curl/file_support.php +++ b/plugins/SecurityInfo/PhpSecInfo/Test/Curl/file_support.php @@ -34,7 +34,7 @@ class PhpSecInfo_Test_Curl_File_Support extends PhpSecInfo_Test_Curl var $recommended_value = '5.1.6+ or 4.4.4+'; function _retrieveCurrentValue() { - $this->current_value = PHP_VERSION; + $this->current_value = phpversion(); } @@ -72,4 +72,4 @@ class PhpSecInfo_Test_Curl_File_Support extends PhpSecInfo_Test_Curl } -} \ No newline at end of file +} -- GitLab