From: Timo Tijhof Date: Tue, 12 May 2015 01:18:31 +0000 (+0100) Subject: resourceloader: Using file cache, prepend warnings after creating response X-Git-Tag: 1.31.0-rc.0~11437 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=ab49fc2658f82dcd3c5b204c63ea8b9bd1703f83;p=lhc%2Fweb%2Fwiklou.git 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 --- 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} */";