From dd49834b9eca9e87cf5a8401e48a53934d22345b Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Fri, 4 Oct 2013 10:05:28 +1300 Subject: [PATCH] BUG Fixing installer not checking display_errors correctly. Fixes issue #2479. Installer sets display_errors on, but it checks the changed value and not the original one set in php.ini. --- dev/install/install.php5 | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dev/install/install.php5 b/dev/install/install.php5 index 92f5e222f..d0d75003a 100644 --- a/dev/install/install.php5 +++ b/dev/install/install.php5 @@ -18,8 +18,11 @@ ini_set('mysql.connect_timeout', 5); // Don't die half was through installation; that does more harm than good ini_set('max_execution_time', 0); -// Prevent a white-screen-of-death -ini_set('display_errors', 'on'); + +// set display_errors php setting to on to force installer to avoid blank screen of death. +// get the original value so it can be used in PHP requirement checks later in this script. +$originalDisplayErrorsValue = ini_get('display_errors'); +ini_set('display_errors', '1'); error_reporting(E_ALL | E_STRICT); @@ -469,7 +472,15 @@ class InstallRequirements { function suggestPHPSetting($settingName, $settingValues, $testDetails) { $this->testing($testDetails); - $val = ini_get($settingName); + + // special case for display_errors, check the original value before + // it was changed at the start of this script. + if($settingName = 'display_errors') { + $val = $originalDisplayErrorsValue; + } else { + $val = ini_get($settingName); + } + if(!in_array($val, $settingValues) && $val != $settingValues) { $testDetails[2] = "$settingName is set to '$val' in php.ini. $testDetails[2]"; $this->warning($testDetails);