8000 bug #20519 [Debug] Remove GLOBALS from exception context to avoid end… · src-run/symfony@0221ffc · GitHub
[go: up one dir, main page]

Skip to content

Commit 0221ffc

Browse files
bug symfony#20519 [Debug] Remove GLOBALS from exception context to avoid endless recursion (Seldaek)
This PR was merged into the 2.7 branch. Discussion ---------- [Debug] Remove GLOBALS from exception context to avoid endless recursion | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT This fixes a endless recursion as seen in felixfbecker/php-language-server#137 - it only happens if you trigger an error in the global context so it's kinda hard to write a test for, but hopefully the fix can be accepted. Commits ------- 1bb95ac [Debug] Remove GLOBALS from exception context to avoid endless recursion
2 parents e24cedb + 1bb95ac commit 0221ffc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public function handleError($type, $message, $file, $line, array $context, array
373373
return $type && $log;
374374
}
375375

376-
if (PHP_VERSION_ID < 50400 && isset($context['GLOBALS']) && ($this->scopedErrors & $type)) {
376+
if (isset($context['GLOBALS']) && ($this->scopedErrors & $type)) {
377377
$e = $context; // Whatever the signature of the method,
378378
unset($e['GLOBALS'], $context); // $context is always a reference in 5.3
379379
$context = $e;

0 commit comments

Comments
 (0)
0