Skip to content
Extraits de code Groupes Projets
Valider bf9d6363 rédigé par robocoder's avatar robocoder
Parcourir les fichiers

PHP_VERSION was introduced in php 5.2.6

git-svn-id: http://dev.piwik.org/svn/trunk@2682 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent f1b86254
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -26,7 +26,7 @@ class PhpSecInfo_Test_Application_Php extends PhpSecInfo_Test_Application ...@@ -26,7 +26,7 @@ class PhpSecInfo_Test_Application_Php extends PhpSecInfo_Test_Application
var $recommended_value = null; var $recommended_value = null;
function _retrieveCurrentValue() { function _retrieveCurrentValue() {
$this->current_value = PHP_VERSION;; $this->current_value = phpversion();;
$url = 'http://php.net/releases/?serialize=1&version=5'; $url = 'http://php.net/releases/?serialize=1&version=5';
$timeout = Piwik_UpdateCheck::SOCKET_TIMEOUT; $timeout = Piwik_UpdateCheck::SOCKET_TIMEOUT;
......
...@@ -47,7 +47,7 @@ class PhpSecInfo_Test_Core_Allow_Url_Fopen extends PhpSecInfo_Test_Core ...@@ -47,7 +47,7 @@ class PhpSecInfo_Test_Core_Allow_Url_Fopen extends PhpSecInfo_Test_Core
* *
*/ */
function _execTest() { 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) { if ($this->current_value == $this->recommended_value) {
return PHPSECINFO_TEST_RESULT_OK; return PHPSECINFO_TEST_RESULT_OK;
} }
...@@ -66,7 +66,7 @@ class PhpSecInfo_Test_Core_Allow_Url_Fopen extends PhpSecInfo_Test_Core ...@@ -66,7 +66,7 @@ class PhpSecInfo_Test_Core_Allow_Url_Fopen extends PhpSecInfo_Test_Core
*/ */
function _setMessages() { function _setMessages() {
parent::_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_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.'); $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 ...@@ -76,4 +76,4 @@ class PhpSecInfo_Test_Core_Allow_Url_Fopen extends PhpSecInfo_Test_Core
} }
} }
\ No newline at end of file
...@@ -57,7 +57,7 @@ class PhpSecInfo_Test_Core_Allow_Url_Include extends PhpSecInfo_Test_Core ...@@ -57,7 +57,7 @@ class PhpSecInfo_Test_Core_Allow_Url_Include extends PhpSecInfo_Test_Core
*/ */
function isTestable() { function isTestable() {
if ( version_compare(PHP_VERSION, '5.2', '<') ) { if ( version_compare(phpversion(), '5.2', '<') ) {
return false; return false;
} else { } else {
return true; return true;
...@@ -79,4 +79,4 @@ class PhpSecInfo_Test_Core_Allow_Url_Include extends PhpSecInfo_Test_Core ...@@ -79,4 +79,4 @@ class PhpSecInfo_Test_Core_Allow_Url_Include extends PhpSecInfo_Test_Core
} }
} }
\ No newline at end of file
...@@ -42,7 +42,7 @@ class PhpSecInfo_Test_Core_Magic_Quotes_GPC extends PhpSecInfo_Test_Core ...@@ -42,7 +42,7 @@ class PhpSecInfo_Test_Core_Magic_Quotes_GPC extends PhpSecInfo_Test_Core
* @return boolean * @return boolean
*/ */
function isTestable() { 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 ...@@ -77,4 +77,4 @@ class PhpSecInfo_Test_Core_Magic_Quotes_GPC extends PhpSecInfo_Test_Core
} }
} }
\ No newline at end of file
...@@ -43,7 +43,7 @@ class PhpSecInfo_Test_Core_Register_Globals extends PhpSecInfo_Test_Core ...@@ -43,7 +43,7 @@ class PhpSecInfo_Test_Core_Register_Globals extends PhpSecInfo_Test_Core
* @return boolean * @return boolean
*/ */
function isTestable() { 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 ...@@ -74,4 +74,4 @@ class PhpSecInfo_Test_Core_Register_Globals extends PhpSecInfo_Test_Core
} }
} }
\ No newline at end of file
...@@ -34,7 +34,7 @@ class PhpSecInfo_Test_Curl_File_Support extends PhpSecInfo_Test_Curl ...@@ -34,7 +34,7 @@ class PhpSecInfo_Test_Curl_File_Support extends PhpSecInfo_Test_Curl
var $recommended_value = '5.1.6+ or 4.4.4+'; var $recommended_value = '5.1.6+ or 4.4.4+';
function _retrieveCurrentValue() { 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 ...@@ -72,4 +72,4 @@ class PhpSecInfo_Test_Curl_File_Support extends PhpSecInfo_Test_Curl
} }
} }
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter