From: Platonides Date: Sat, 18 Jun 2011 20:15:48 +0000 (+0000) Subject: Follow up r90361 X-Git-Tag: 1.31.0-rc.0~29432 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=6be5bc3b63a57255a7d75aec7f52fe0982a9a284;p=lhc%2Fweb%2Fwiklou.git Follow up r90361 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 67f5e2848b..4de4c8ba67 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1359,7 +1359,7 @@ function wfReportTime() { * * @return array of backtrace information */ -function wfDebugBacktrace() { +function wfDebugBacktrace( $limit = 0 ) { static $disabled = null; if( extension_loaded( 'Zend Optimizer' ) ) { @@ -1381,7 +1381,7 @@ function wfDebugBacktrace() { return array(); } - if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) { + if ( $limit && 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 ); @@ -1446,7 +1446,7 @@ function wfBacktrace() { * @return Bool|string */ function wfGetCaller( $level = 2 ) { - $backtrace = wfDebugBacktrace(); + $backtrace = wfDebugBacktrace( $level ); if ( isset( $backtrace[$level] ) ) { return wfFormatStackFrame( $backtrace[$level] ); } else {