X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2FWebResponse.php;h=f5fb47fc5bbca1bcd34fb7866a61c8ae1a2976bc;hb=c78d1c842f7d4306cc20ffe4123e50fcf341fe76;hp=90b76e33276a6bca71fdee34e9050c59a354b7b3;hpb=7dd1914e734ccd7c2842bb2e18bf4866a4ecbf63;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 ); + } } /**