Skip to content

Commit

Permalink
fix detecting anonymous exception classes on Windows and PHP 7
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Nov 5, 2024
1 parent 108d436 commit fb0d476
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ protected function doRenderThrowable(\Throwable $e, OutputInterface $output): vo
}

if (str_contains($message, "@anonymous\0")) {
$message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
$message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)?[0-9a-fA-F]++/', function ($m) {
return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
}, $message);
}
Expand Down

0 comments on commit fb0d476

Please sign in to comment.