From 5d9d44dc5eecdc3786130e0347d753e686d35bdf Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Mon, 29 Aug 2011 11:49:22 +0000 Subject: [PATCH] Fix: detection of the Suhosin extension during the installation and tell the user if the get_max_value is too small. SVN:trunk[1528] --- setup/index.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/setup/index.php b/setup/index.php index 53207617e..ff405b248 100644 --- a/setup/index.php +++ b/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 !';