Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a51431d

Browse files
committed
[ErrorHandler] Do not patch return types that are not a valid PHP type
1 parent ff46689 commit a51431d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/Symfony/Component/ErrorHandler/DebugClassLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,10 @@ private function setReturnType(string $types, string $class, string $method, str
853853
return;
854854
}
855855

856+
if (!preg_match('/^[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*$/', $n)) {
857+
continue;
858+
}
859+
856860
if (!isset($phpTypes[''])) {
857861
$phpTypes[] = $n;
858862
}

0 commit comments

Comments
 (0)