From a5091d9af01a2a33d66e8e565bf87d1eeec28609 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 28 Jun 2011 15:13:10 +0000 Subject: [PATCH] Fixed regression: magic_quote_runtime could be deprecated with recent versions of PHP (setup) SVN:trunk[1306] --- setup/index.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/setup/index.php b/setup/index.php index e13041773..6bacb5d11 100644 --- a/setup/index.php +++ b/setup/index.php @@ -261,15 +261,21 @@ function CheckPHPVersion(SetupWebPage $oP) $oP->log("Info - max_file_uploads: ".ini_get('max_file_uploads')); // Check some more ini settings here, needed for file upload - if (get_magic_quotes_gpc()) - { - $aErrors[] = "'magic_quotes_gpc' is set to On. Please turn it Off before continuing. You may want to check the PHP configuration file(s): '$sPhpIniFile'. Be aware that this setting can also be overridden in the apache configuration."; - $bResult = false; + if (function_exists('get_magic_quotes_gpc')) + { + if (@get_magic_quotes_gpc()) + { + $aErrors[] = "'magic_quotes_gpc' is set to On. Please turn it Off before continuing. You may want to check the PHP configuration file(s): '$sPhpIniFile'. Be aware that this setting can also be overridden in the apache configuration."; + $bResult = false; + } } - if (magic_quotes_runtime()) - { - $aErrors[] = "'magic_quotes_runtime' is set to On. Please turn it Off before continuing. You may want to check the PHP configuration file(s): '$sPhpIniFile'. Be aware that this setting can also be overridden in the apache configuration."; - $bResult = false; + if (function_exists('magic_quotes_runtime')) + { + if (@magic_quotes_runtime()) + { + $aErrors[] = "'magic_quotes_runtime' is set to On. Please turn it Off before continuing. You may want to check the PHP configuration file(s): '$sPhpIniFile'. Be aware that this setting can also be overridden in the apache configuration."; + $bResult = false; + } }