From: Chad Horohoe Date: Thu, 14 Jul 2011 17:48:41 +0000 (+0000) Subject: Use the context's response for header() calls in checkMaxLag() X-Git-Tag: 1.31.0-rc.0~28841 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=5e95c48e285b7125a305f08cf4fd76064134ed74;p=lhc%2Fweb%2Fwiklou.git Use the context's response for header() calls in checkMaxLag() --- diff --git a/includes/Wiki.php b/includes/Wiki.php index 4c99a72792..412fcd6ad1 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -551,10 +551,11 @@ class MediaWiki { list( $host, $lag ) = $lb->getMaxLag(); if ( $lag > $maxLag ) { if ( $abort ) { - header( 'HTTP/1.1 503 Service Unavailable' ); - header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) ); - header( 'X-Database-Lag: ' . intval( $lag ) ); - header( 'Content-Type: text/plain' ); + $resp = $this->context->getRequest()->response(); + $resp->header( 'HTTP/1.1 503 Service Unavailable' ); + $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) ); + $resp->header( 'X-Database-Lag: ' . intval( $lag ) ); + $resp->header( 'Content-Type: text/plain' ); if( $wgShowHostnames ) { echo "Waiting for $host: $lag seconds lagged\n"; } else {