exception: Account for $call['file'] and $call['line'] being unset
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 11 Oct 2013 18:18:07 +0000 (20:18 +0200)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 11 Oct 2013 18:42:55 +0000 (20:42 +0200)
Bug: 55634
Change-Id: I1173216cade73216848816f6bb51e54096abdfde

includes/Exception.php

index 39fe6f4..6724c4a 100644 (file)
@@ -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 {