r95024 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95023‎ | r95024 | r95025 >
Date:18:38, 19 August 2011
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
fix for Bug 30458 - mobile link to view images site is flaky
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.38';
 69+ const VERSION = '0.5.39';
7070
7171 /**
7272 * @var DOMDocument
@@ -242,6 +242,8 @@
243243
244244 if ( self::$disableImages == 1 ) {
245245 $wgRequest->response()->setcookie( 'disableImages', 1 );
 246+ $location = str_replace( '?disableImages=1', '', $wgRequest->getRequestURL() );
 247+ header( 'Location: ' . $location );
246248 }
247249
248250 if ( self::$disableImages == 0 ) {
@@ -255,6 +257,8 @@
256258 $disableImages = $wgRequest->getCookie( 'disableImages' );
257259 if ( $disableImages ) {
258260 $wgRequest->response()->setcookie( 'disableImages', '' );
 261+ $location = str_replace( '?enableImages=1', '', $wgRequest->getRequestURL() );
 262+ header( 'Location: ' . $location );
259263 }
260264 }
261265

Follow-up revisions

RevisionCommit summaryAuthorDate
r95026mft r95024preilly18:42, 19 August 2011
r95028use WebResponse::header() rather than raw header() callspreilly18:51, 19 August 2011

Comments

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

Use WebResponse::header() rather than raw header() calls.

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

This should now be fixed in r95028.

Status & tagging log