Skip to content

Commit

Permalink
Callback: removes HTML from error message [Closes nette/mail#54]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 18, 2018
1 parent 153d783 commit 89a88fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Utils/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ public static function invokeSafe($function, array $args, $onError)
$file = func_get_arg(5)[1]['file'];
}
if ($file === __FILE__) {
$msg = preg_replace("#^$function\(.*?\): #", '', $message);
$msg = $message;
if (ini_get('html_errors')) {
$msg = html_entity_decode(strip_tags($msg));
}
$msg = preg_replace("#^$function\(.*?\): #", '', $msg);
if ($onError($msg, $severity) !== false) {
return;
}
Expand Down

0 comments on commit 89a88fc

Please sign in to comment.