Browse Source

Fixed regression: magic_quote_runtime could be deprecated with recent versions of PHP (setup)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1306 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 years ago
parent
commit
c9007f06dc
1 changed files with 14 additions and 8 deletions
  1. 14 8
      setup/index.php

+ 14 - 8
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;
+		}
 	}