File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424use function function_exists ;
2525use function htmlspecialchars ;
2626use function sprintf ;
27+ use function str_contains ;
28+ use function str_replace ;
2729
30+ use const DIRECTORY_SEPARATOR ;
2831use const E_COMPILE_ERROR ;
2932use const E_COMPILE_WARNING ;
3033use const E_CORE_ERROR ;
@@ -224,10 +227,8 @@ public function handleError(
224227 */
225228 public function handleException (Throwable $ exception ): void
226229 {
227- $ message = $ exception ::class . ': ' . $ exception ->getMessage ();
228-
229230 $ this ->addError (
230- $ message ,
231+ $ exception ::class . ' : ' . $ exception -> getMessage () ,
231232 (int ) $ exception ->getCode (),
232233 $ exception ->getFile (),
233234 $ exception ->getLine (),
@@ -258,6 +259,10 @@ public function addError(
258259 int $ errline ,
259260 bool $ escape = true ,
260261 ): void {
262+ if (str_contains ($ errstr , ROOT_PATH )) {
263+ $ errstr = str_replace (ROOT_PATH , '. ' . DIRECTORY_SEPARATOR , $ errstr );
264+ }
265+
261266 if ($ escape ) {
262267 $ errstr = htmlspecialchars ($ errstr );
263268 }
You can’t perform that action at this time.
0 commit comments