From ab49fc2658f82dcd3c5b204c63ea8b9bd1703f83 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 12 May 2015 02:18:31 +0100 Subject: [PATCH] resourceloader: Using file cache, prepend warnings after creating response Follows-up a4379d8f9e0 which broke the warning output. Previously it was appending warnings to a non-existent "$response" variable and then re-assigning it with the actual response, thus never outputting this anywhere. Change-Id: I6c53e7ccb4ae4783d496c06c7174c9d8a1a88b55 --- includes/resourceloader/ResourceLoader.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 55dc16e7a8..8c9c130bf7 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -805,14 +805,14 @@ class ResourceLoader { if ( $this->tryRespondLastModified( $context, $ts ) ) { return false; // output handled (buffers cleared) } + // Send content type and cache headers + $this->sendResponseHeaders( $context, $ts, false ); + $response = $fileCache->fetchText(); // Capture any PHP warnings from the output buffer and append them to the // response in a comment if we're in debug mode. if ( $context->getDebug() && strlen( $warnings = ob_get_contents() ) ) { $response = self::makeComment( $warnings ) . $response; } - // Send content type and cache headers - $this->sendResponseHeaders( $context, $ts, false ); - $response = $fileCache->fetchText(); // Remove the output buffer and output the response ob_end_clean(); echo $response . "\n/* Cached {$ts} */"; -- 2.20.1