Skip to content

Commit

Permalink
Callback::invokeSafe() removes function name also with arguments from…
Browse files Browse the repository at this point in the history
… error message
  • Loading branch information
dg committed Nov 30, 2015
1 parent 6cde5bc commit 6f1ed73
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Utils/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6f1ed73

Please sign in to comment.