From 89a88fc36f5bb76f9355ed8a09820cefcbb0af39 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Mon, 17 Sep 2018 14:11:15 +0200 Subject: [PATCH] Callback: removes HTML from error message [Closes nette/mail#54] --- src/Utils/Callback.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Utils/Callback.php b/src/Utils/Callback.php index b392721fe..ae5806466 100644 --- a/src/Utils/Callback.php +++ b/src/Utils/Callback.php @@ -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; }