Jelajahi Sumber

Fix: detection of the Suhosin extension during the installation and tell the user if the get_max_value is too small.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1528 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 13 tahun lalu
induk
melakukan
721edda101
1 mengubah file dengan 18 tambahan dan 0 penghapusan
  1. 18 0
      setup/index.php

+ 18 - 0
setup/index.php

@@ -37,6 +37,7 @@ define('FINAL_CONFIG_FILE', APPROOT.'/config-itop.php');
 define('PHP_MIN_VERSION', '5.2.0');
 define('MYSQL_MIN_VERSION', '5.0.0');
 define('MIN_MEMORY_LIMIT', 32*1024*1024);
+define('SUHOSIN_GET_MAX_VALUE_LENGTH', 1024); 
 
 $sOperation = Utils::ReadParam('operation', 'step0');
 $oP = new SetupWebPage('iTop configuration wizard');
@@ -310,6 +311,23 @@ function CheckPHPVersion(SetupWebPage $oP)
 		$aOk[] = "APC detected (version $sAPCVersion). The APC cache will be used to speed-up iTop.";
 	}
 
+	// Special case Suhosin extension
+	if (extension_loaded('suhosin'))
+	{
+		$sSuhosinVersion = phpversion('suhosin');
+		$aOk[] = "Suhosin extension detected (version $sSuhosinVersion).";
+		
+		$iGetMaxValueLength = ini_get('suhosin.get.max_value_length');
+		if ($iGetMaxValueLength < SUHOSIN_GET_MAX_VALUE_LENGTH)
+		{
+			$aErrors[] = "suhosin.get.max_value_length ($iGetMaxValueLength) is too small, the minimum value to run iTop is ".SUHOSIN_GET_MAX_VALUE_LENGTH.". This value is set by the PHP configuration file(s): '$sPhpIniFile'. Be aware that this setting can also be overridden in the apache configuration.";		
+			$bResult = false;
+		}
+		else
+		{
+			$oP->log_info("suhosin.get.max_value_length = $iGetMaxValueLength, ok.");		
+		}
+	}
 	if (!$bResult)
 	{
 		$sTitle = 'Checking prerequisites: Failed !';