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 a692561 commit 28d4e3e
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 @@ -68,7 +68,11 @@ public static function invokeSafe(string $function, array $args, callable $onErr
{
$prev = set_error_handler(function ($severity, $message, $file) use ($onError, &$prev, $function) {
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 28d4e3e

Please sign in to comment.