[Debug] ErrorHandler: remove $GLOBALS from context in PHP5.3 fix #10292

This commit is contained in:
Nicolas Grekas 2014-04-28 18:07:34 +02:00
parent 37a4876d8b
commit ed0ed80286
1 changed files with 4 additions and 0 deletions

View File

@ -126,6 +126,10 @@ class ErrorHandler
require __DIR__.'/Exception/ContextErrorException.php';
}
if (PHP_VERSION_ID < 50400 && isset($context['GLOBALS'])) {
unset($context['GLOBALS']);
}
$exception = new ContextErrorException(sprintf('%s: %s in %s line %d', isset($this->levels[$level]) ? $this->levels[$level] : $level, $message, $file, $line), 0, $level, $file, $line, $context);
// Exceptions thrown from error handlers are sometimes not caught by the exception