diff --git a/setup/ajax.dataloader.php b/setup/ajax.dataloader.php
index e39e6ff03..cfb2266fc 100644
--- a/setup/ajax.dataloader.php
+++ b/setup/ajax.dataloader.php
@@ -1,5 +1,5 @@
'.$sLogMessage.''.PHP_FATAL_ERROR_TAG.'>';
}
function FatalErrorCatcher($sOutput)
-{
- if ( preg_match('|.*|s', $sOutput, $aMatches) )
+{
+ if (preg_match('|<'.PHP_FATAL_ERROR_TAG.'>.*'.PHP_FATAL_ERROR_TAG.'>|s', $sOutput, $aMatches))
{
header("HTTP/1.0 500 Internal server error.");
$errors = '';
@@ -97,9 +121,11 @@ function FatalErrorCatcher($sOutput)
//Define some bogus, invalid HTML tags that no sane
//person would ever put in an actual document and tell
//PHP to delimit fatal error warnings with them.
-ini_set('error_prepend_string', '');
-ini_set('error_append_string', '');
+ini_set('error_prepend_string', '<'.PHP_FATAL_ERROR_TAG.'>');
+ini_set('error_append_string', ''.PHP_FATAL_ERROR_TAG.'>');
+// callback on errors to log
+register_shutdown_function('ShutdownCallback');
// Starts the capture of the ouput, and sets a filter to capture the fatal errors.
ob_start('FatalErrorCatcher'); // Start capturing the output, and pass it through the fatal error catcher
@@ -140,6 +166,7 @@ try
$oDummyController = new WizardController('');
if (is_subclass_of($sClass, 'WizardStep'))
{
+ /** @var WizardStep $oStep */
$oStep = new $sClass($oDummyController, $sState);
$sConfigFile = utils::GetConfigFilePath();
if (file_exists($sConfigFile) && !is_writable($sConfigFile) && $oStep->RequiresWritableConfig())
@@ -179,4 +206,3 @@ if (function_exists('memory_get_peak_usage'))
SetupPage::log_info("operation '$sOperation', peak memory usage. ".memory_get_peak_usage());
}
}
-?>