Handle $frame['function'] not being set in stack frames
authorAlex Monk <krenair@gmail.com>
Fri, 9 Oct 2015 16:58:26 +0000 (17:58 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Wed, 14 Oct 2015 13:05:29 +0000 (13:05 +0000)
Bug: T115107
Change-Id: I9fbfcd53fbcba1800a924acb1a1702c3c9037cc5

includes/GlobalFunctions.php
includes/exception/MWExceptionHandler.php

index 14327dc..8fa42e9 100644 (file)
@@ -1985,6 +1985,9 @@ function wfGetAllCallers( $limit = 3 ) {
  * @return string
  */
 function wfFormatStackFrame( $frame ) {
+       if ( !isset( $frame['function'] ) ) {
+               return 'NO_FUNCTION_GIVEN';
+       }
        return isset( $frame['class'] ) ?
                $frame['class'] . '::' . $frame['function'] :
                $frame['function'];
index 4e50070..5734902 100644 (file)
@@ -380,10 +380,12 @@ TXT;
                                $text .= "{$pad}#{$level} [internal function]: ";
                        }
 
-                       if ( isset( $frame['class'] ) ) {
+                       if ( isset( $frame['class'] ) && isset( $frame['type'] ) && isset( $frame['function'] ) ) {
                                $text .= $frame['class'] . $frame['type'] . $frame['function'];
-                       } else {
+                       } elseif ( isset( $frame['function'] ) ) {
                                $text .= $frame['function'];
+                       } else {
+                               $text .= 'NO_FUNCTION_GIVEN';
                        }
 
                        if ( isset( $frame['args'] ) ) {