From 3ca7f919e01617c4685efce285299aa351ff1dac Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 11 Oct 2013 20:18:07 +0200 Subject: [PATCH] exception: Account for $call['file'] and $call['line'] being unset Bug: 55634 Change-Id: I1173216cade73216848816f6bb51e54096abdfde --- includes/Exception.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/Exception.php b/includes/Exception.php index 39fe6f4b30..6724c4adec 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -737,7 +737,15 @@ class MWExceptionHandler { } } - $finalExceptionText .= "#{$i} {$call['file']}({$call['line']}): "; + if ( isset( $call['file'] ) && isset( $call['line'] ) ) { + $finalExceptionText .= "#{$i} {$call['file']}({$call['line']}): "; + } else { + // 'file' and 'line' are unset for calls via call_user_func (bug 55634) + // This matches behaviour of Exception::getTraceAsString to instead + // display "[internal function]". + $finalExceptionText .= "#{$i} [internal function]: "; + } + if ( isset( $call['class'] ) ) { $finalExceptionText .= $call['class'] . $call['type'] . $call['function']; } else { -- 2.20.1