r95028 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95027‎ | r95028 | r95029 >
Date:18:51, 19 August 2011
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
use WebResponse::header() rather than raw header() calls
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -65,7 +65,7 @@
6666 );
6767
6868 class ExtMobileFrontend {
69 - const VERSION = '0.5.39';
 69+ const VERSION = '0.5.40';
7070
7171 /**
7272 * @var DOMDocument
@@ -243,7 +243,7 @@
244244 if ( self::$disableImages == 1 ) {
245245 $wgRequest->response()->setcookie( 'disableImages', 1 );
246246 $location = str_replace( '?disableImages=1', '', $wgRequest->getRequestURL() );
247 - header( 'Location: ' . $location );
 247+ WebResponse::header( 'Location: ' . $location );
248248 }
249249
250250 if ( self::$disableImages == 0 ) {
@@ -258,7 +258,7 @@
259259 if ( $disableImages ) {
260260 $wgRequest->response()->setcookie( 'disableImages', '' );
261261 $location = str_replace( '?enableImages=1', '', $wgRequest->getRequestURL() );
262 - header( 'Location: ' . $location );
 262+ WebResponse::header( 'Location: ' . $location );
263263 }
264264 }
265265
@@ -310,7 +310,7 @@
311311 $this->setOptInOutCookie( '1' );
312312 $this->disableCaching();
313313 $location = Title::newMainPage()->getFullURL();
314 - header( 'Location: ' . $location );
 314+ WebResponse::header( 'Location: ' . $location );
315315 }
316316
317317 if ( $mobileAction == 'opt_out_cookie' ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r95029mft r95028preilly18:53, 19 August 2011
r95030fix for calling WebResponse statically fix for r95028preilly18:59, 19 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95024fix for Bug 30458 - mobile link to view images site is flakypreilly18:38, 19 August 2011

Comments

#Comment by 😂 (talk | contribs)   18:53, 19 August 2011

Noooo, it's not a static method. Use $wgRequest->response()->header() like you do with setcookie(). Sorry if I wasn't clear.

#Comment by Preilly (talk | contribs)   19:00, 19 August 2011

Okay, this should now be fixed in r95030.

#Comment by Preilly (talk | contribs)   19:01, 19 August 2011

Okay, this should now be fixed in r95030.

Status & tagging log