Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -297,7 +297,6 @@ |
298 | 298 | function wfDebug( $text, $logonly = false ) { |
299 | 299 | global $wgOut, $wgDebugLogFile, $wgDebugComments, $wgProfileOnly, $wgDebugRawPage; |
300 | 300 | global $wgDebugLogPrefix, $wgShowDebug; |
301 | | - static $recursion = 0; |
302 | 301 | |
303 | 302 | static $cache = array(); // Cache of unoutputted messages |
304 | 303 | $text = wfDebugTimer() . $text; |
— | — | @@ -310,21 +309,11 @@ |
311 | 310 | if ( ( $wgDebugComments || $wgShowDebug ) && !$logonly ) { |
312 | 311 | $cache[] = $text; |
313 | 312 | |
314 | | - if ( !isset( $wgOut ) ) { |
315 | | - return; |
| 313 | + if ( isset( $wgOut ) && StubObject::isRealObject( $wgOut ) ) { |
| 314 | + // add the message and any cached messages to the output |
| 315 | + array_map( array( $wgOut, 'debug' ), $cache ); |
| 316 | + $cache = array(); |
316 | 317 | } |
317 | | - if ( !StubObject::isRealObject( $wgOut ) ) { |
318 | | - if ( $recursion ) { |
319 | | - return; |
320 | | - } |
321 | | - $recursion++; |
322 | | - $wgOut->_unstub(); |
323 | | - $recursion--; |
324 | | - } |
325 | | - |
326 | | - // add the message and possible cached ones to the output |
327 | | - array_map( array( $wgOut, 'debug' ), $cache ); |
328 | | - $cache = array(); |
329 | 318 | } |
330 | 319 | if ( $wgDebugLogFile != '' && !$wgProfileOnly ) { |
331 | 320 | # Strip unprintables; they can switch terminal modes when binary data |