r96022 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96021‎ | r96022 | r96023 >
Date:18:17, 1 September 2011
Author:preilly
Status:ok
Tags:
Comment:
mft r96021
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -265,10 +265,10 @@
266266
267267 if ( self::$disableImages == 1 ) {
268268 $wgRequest->response()->setcookie( 'disableImages', 1 );
269 - $location = str_replace( 'disableImages=1', '', $wgRequest->getRequestURL() );
 269+ $location = str_replace('?disableImages=1', '', str_replace( '&disableImages=1', '', $wgRequest->appendQuery('mfi=0') ) );
270270 $wgRequest->response()->header( 'Location: ' . $location );
271271 }
272 -
 272+
273273 if ( self::$disableImages == 0 ) {
274274 $disableImages = $wgRequest->getCookie( 'disableImages' );
275275 if ( $disableImages ) {
@@ -280,12 +280,11 @@
281281 $disableImages = $wgRequest->getCookie( 'disableImages' );
282282 if ( $disableImages ) {
283283 $wgRequest->response()->setcookie( 'disableImages', '' );
284 - $location = str_replace( 'enableImages=1', '', $wgRequest->getRequestURL() );
285 - $wgRequest->response()->header( 'Location: ' . $location );
286284 }
 285+ $location = str_replace( '?enableImages=1', '', str_replace( '&enableImages=1', '', $wgRequest->appendQuery('mfi=1') ) );
 286+ $wgRequest->response()->header( 'Location: ' . $location );
287287 }
288288
289 -
290289 self::$useFormat = $wgRequest->getText( 'useformat' );
291290 self::$format = $wgRequest->getText( 'format' );
292291 self::$requestedSegment = $wgRequest->getText( 'seg', 0 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96021small fix for image enable/disable caching issuepreilly18:15, 1 September 2011

Status & tagging log