"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/base/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php" between
phplist-3.4.5.tgz and phplist-3.4.6.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

ErrorHandler.php  (phplist-3.4.5.tgz):ErrorHandler.php  (phplist-3.4.6.tgz)
skipping to change at line 453 skipping to change at line 453
} }
if (100 < ++self::$silencedErrorCount) { if (100 < ++self::$silencedErrorCount) {
self::$silencedErrorCache = $lightTrace = []; self::$silencedErrorCache = $lightTrace = [];
self::$silencedErrorCount = 1; self::$silencedErrorCount = 1;
} }
if ($errorAsException) { if ($errorAsException) {
self::$silencedErrorCache[$id][$message] = $errorAsException; self::$silencedErrorCache[$id][$message] = $errorAsException;
} }
if (null === $lightTrace) { if (null === $lightTrace) {
return; return true;
} }
} else { } else {
if ($scope) { if ($scope) {
$errorAsException = new ContextErrorException($logMessage, 0, $t ype, $file, $line, $context); $errorAsException = new ContextErrorException($logMessage, 0, $t ype, $file, $line, $context);
} else { } else {
$errorAsException = new \ErrorException($logMessage, 0, $type, $ file, $line); $errorAsException = new \ErrorException($logMessage, 0, $type, $ file, $line);
} }
// Clean the trace by removing function arguments and the first fram es added by the error handler itself. // Clean the trace by removing function arguments and the first fram es added by the error handler itself.
if ($throw || $this->tracedErrors & $type) { if ($throw || $this->tracedErrors & $type) {
$backtrace = $backtrace ?: $errorAsException->getTrace(); $backtrace = $backtrace ?: $errorAsException->getTrace();
$lightTrace = $this->cleanTrace($backtrace, $type, $file, $line, $throw); $lightTrace = $this->cleanTrace($backtrace, $type, $file, $line, $throw);
$this->traceReflector->setValue($errorAsException, $lightTrace); $this->traceReflector->setValue($errorAsException, $lightTrace);
} else { } else {
$this->traceReflector->setValue($errorAsException, []); $this->traceReflector->setValue($errorAsException, []);
} }
} }
if ($throw) { if ($throw) {
if (E_USER_ERROR & $type) { if (\PHP_VERSION_ID < 70400 && E_USER_ERROR & $type) {
for ($i = 1; isset($backtrace[$i]); ++$i) { for ($i = 1; isset($backtrace[$i]); ++$i) {
if (isset($backtrace[$i]['function'], $backtrace[$i]['type'] , $backtrace[$i - 1]['function']) if (isset($backtrace[$i]['function'], $backtrace[$i]['type'] , $backtrace[$i - 1]['function'])
&& '__toString' === $backtrace[$i]['function'] && '__toString' === $backtrace[$i]['function']
&& '->' === $backtrace[$i]['type'] && '->' === $backtrace[$i]['type']
&& !isset($backtrace[$i - 1]['class']) && !isset($backtrace[$i - 1]['class'])
&& ('trigger_error' === $backtrace[$i - 1]['function'] | | 'user_error' === $backtrace[$i - 1]['function']) && ('trigger_error' === $backtrace[$i - 1]['function'] | | 'user_error' === $backtrace[$i - 1]['function'])
) { ) {
// Here, we know trigger_error() has been called from __ toString(). // Here, we know trigger_error() has been called from __ toString().
// HHVM is fine with throwing from __toString() but PHP triggers a fatal error instead. // HHVM is fine with throwing from __toString() but PHP triggers a fatal error instead.
// A small convention allows working around the limitati on: // A small convention allows working around the limitati on:
skipping to change at line 602 skipping to change at line 602
if ($e = $handler->handleError($error, $exception)) { if ($e = $handler->handleError($error, $exception)) {
$exception = $e; $exception = $e;
break; break;
} }
} }
} }
$exceptionHandler = $this->exceptionHandler; $exceptionHandler = $this->exceptionHandler;
$this->exceptionHandler = null; $this->exceptionHandler = null;
try { try {
if (null !== $exceptionHandler) { if (null !== $exceptionHandler) {
return \call_user_func($exceptionHandler, $exception); $exceptionHandler($exception);
return;
} }
$handlerException = $handlerException ?: $exception; $handlerException = $handlerException ?: $exception;
} catch (\Exception $handlerException) { } catch (\Exception $handlerException) {
} catch (\Throwable $handlerException) { } catch (\Throwable $handlerException) {
} }
if ($exception === $handlerException) { if ($exception === $handlerException) {
self::$reservedMemory = null; // Disable the fatal error handler self::$reservedMemory = null; // Disable the fatal error handler
throw $exception; // Give back $exception to the native handler throw $exception; // Give back $exception to the native handler
} }
$this->handleException($handlerException); $this->handleException($handlerException);
 End of changes. 3 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)