X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWebResponse.php;h=f5fb47fc5bbca1bcd34fb7866a61c8ae1a2976bc;hb=c78d1c842f7d4306cc20ffe4123e50fcf341fe76;hp=90b76e33276a6bca71fdee34e9050c59a354b7b3;hpb=b3307c8a5a6b1ea0820b91687f83aaf23f8cd29f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebResponse.php b/includes/WebResponse.php index 90b76e3327..f5fb47fc5b 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -39,7 +39,14 @@ class WebResponse { * @param null|int $http_response_code Forces the HTTP response code to the specified value. */ public function header( $string, $replace = true, $http_response_code = null ) { - header( $string, $replace, $http_response_code ); + if ( headers_sent() ) { + MWDebug::warning( 'Headers already sent, should send headers earlier than ' . wfGetCaller() ); + } + if ( $http_response_code ) { + header( $string, $replace, $http_response_code ); + } else { + header( $string, $replace ); + } } /**