Index: trunk/phase3/includes/resourceloader/ResourceLoader.php |
— | — | @@ -573,6 +573,11 @@ |
574 | 574 | return false; // output handled (buffers cleared) |
575 | 575 | } |
576 | 576 | $response = $fileCache->fetchText(); |
| 577 | + // Capture any PHP warnings from the output buffer and append them to the |
| 578 | + // response in a comment if we're in debug mode. |
| 579 | + if ( $context->getDebug() && strlen( $warnings = ob_get_contents() ) ) { |
| 580 | + $response = "/*\n$warnings\n*/\n" . $response; |
| 581 | + } |
577 | 582 | // Remove the output buffer and output the response |
578 | 583 | ob_end_clean(); |
579 | 584 | echo $response . "\n/* Cached {$ts} */"; |