diff --git a/src/Utils/Callback.php b/src/Utils/Callback.php index 03b45902c..24f61ba1a 100644 --- a/src/Utils/Callback.php +++ b/src/Utils/Callback.php @@ -88,12 +88,13 @@ public static function invokeSafe($function, array $args, $onError) if ($file === '' && defined('HHVM_VERSION')) { // https://github.com/facebook/hhvm/issues/4625 $file = $stack[1]['file']; } - if ($file === __FILE__ && $onError(str_replace("$function(): ", '', $message), $severity) !== FALSE) { - return; - } elseif ($prev) { - return call_user_func_array($prev, func_get_args()); + if ($file === __FILE__) { + $msg = preg_replace("#^$function\(.*?\): #", '', $message); + if ($onError($msg, $severity) !== FALSE) { + return; + } } - return FALSE; + return $prev ? call_user_func_array($prev, func_get_args()) : FALSE; }); try {