There is a nice $limit parameter in PHP 5.4, but calling debug_backtrace on earlier...
authorPlatonides <platonides@users.mediawiki.org>
Sat, 18 Jun 2011 20:11:45 +0000 (20:11 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Sat, 18 Jun 2011 20:11:45 +0000 (20:11 +0000)
includes/GlobalFunctions.php

index f1b6ce9..67f5e28 100644 (file)
@@ -1381,7 +1381,11 @@ function wfDebugBacktrace() {
                return array();
        }
 
-       return array_slice( debug_backtrace(), 1 );
+       if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
+               return array_slice( debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT, 1 ), 1 );
+       } else {
+               return array_slice( debug_backtrace(), 1 );
+       }
 }
 
 /**