Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -331,8 +331,7 @@ |
332 | 332 | static $cache = array(); // Cache of unoutputted messages |
333 | 333 | $text = wfDebugTimer() . $text; |
334 | 334 | |
335 | | - # Check for raw action using $_GET not $wgRequest, since the latter might not be initialised yet |
336 | | - if ( isset( $_GET['action'] ) && $_GET['action'] == 'raw' && !$wgDebugRawPage ) { |
| 335 | + if ( !$wgDebugRawPage && wfIsDebugRawPage() ) { |
337 | 336 | return; |
338 | 337 | } |
339 | 338 | |
— | — | @@ -357,6 +356,28 @@ |
358 | 357 | } |
359 | 358 | |
360 | 359 | /** |
| 360 | + * Returns true if debug logging should be suppressed if $wgDebugRawPage = false |
| 361 | + */ |
| 362 | +function wfIsDebugRawPage() { |
| 363 | + static $cache; |
| 364 | + if ( $cache !== null ) { |
| 365 | + return $cache; |
| 366 | + } |
| 367 | + # Check for raw action using $_GET not $wgRequest, since the latter might not be initialised yet |
| 368 | + if ( ( isset( $_GET['action'] ) && $_GET['action'] == 'raw' ) |
| 369 | + || ( |
| 370 | + isset( $_SERVER['SCRIPT_NAME'] ) |
| 371 | + && substr( $_SERVER['SCRIPT_NAME'], -8 ) == 'load.php' |
| 372 | + ) ) |
| 373 | + { |
| 374 | + $cache = true; |
| 375 | + } else { |
| 376 | + $cache = false; |
| 377 | + } |
| 378 | + return $cache; |
| 379 | +} |
| 380 | + |
| 381 | +/** |
361 | 382 | * Get microsecond timestamps for debug logs |
362 | 383 | * |
363 | 384 | * @return string |
— | — | @@ -523,7 +544,7 @@ |
524 | 545 | $profiler->logData(); |
525 | 546 | |
526 | 547 | // Check whether this should be logged in the debug file. |
527 | | - if ( $wgDebugLogFile == '' || ( $wgRequest->getVal( 'action' ) == 'raw' && !$wgDebugRawPage ) ) { |
| 548 | + if ( $wgDebugLogFile == '' || ( !$wgDebugRawPage && wfIsDebugRawPage() ) ) { |
528 | 549 | return; |
529 | 550 | } |
530 | 551 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3823,7 +3823,7 @@ |
3824 | 3824 | $wgDebugRedirects = false; |
3825 | 3825 | |
3826 | 3826 | /** |
3827 | | - * If true, log debugging data from action=raw. |
| 3827 | + * If true, log debugging data from action=raw and load.php. |
3828 | 3828 | * This is normally false to avoid overlapping debug entries due to gen=css and |
3829 | 3829 | * gen=js requests. |
3830 | 3830 | */ |