From: Chad Horohoe Date: Wed, 8 Feb 2017 21:29:31 +0000 (-0800) Subject: Log a warning when headers were already sent and we can't X-Git-Tag: 1.31.0-rc.0~4122 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=c78d1c842f7d4306cc20ffe4123e50fcf341fe76;p=lhc%2Fweb%2Fwiklou.git Log a warning when headers were already sent and we can't Change-Id: Id01f4712e3dd297594e9ed2389ad411be5f553e7 --- diff --git a/includes/WebResponse.php b/includes/WebResponse.php index 339b2e3ff0..f5fb47fc5b 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -39,6 +39,9 @@ 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 ) { + 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 {