r96028 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96027‎ | r96028 | r96029 >
Date:19:12, 1 September 2011
Author:preilly
Status:ok
Tags:
Comment:
mft r96027
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -265,8 +265,9 @@
266266
267267 if ( self::$disableImages == 1 ) {
268268 $wgRequest->response()->setcookie( 'disableImages', 1 );
269 - $location = str_replace('?disableImages=1', '', str_replace( '&disableImages=1', '', $wgRequest->appendQuery('mfi=0') ) );
270 - $wgRequest->response()->header( 'Location: ' . $location );
 269+ $location = str_replace( '?disableImages=1', '', str_replace( '&disableImages=1', '', $wgRequest->getFullRequestURL() ) );
 270+ $location = str_replace( '&mfi=1', '', str_replace( '&mfi=0', '', $location ) );
 271+ $wgRequest->response()->header( 'Location: ' . $location . '&mfi=0' );
271272 }
272273
273274 if ( self::$disableImages == 0 ) {
@@ -281,8 +282,9 @@
282283 if ( $disableImages ) {
283284 $wgRequest->response()->setcookie( 'disableImages', '' );
284285 }
285 - $location = str_replace( '?enableImages=1', '', str_replace( '&enableImages=1', '', $wgRequest->appendQuery('mfi=1') ) );
286 - $wgRequest->response()->header( 'Location: ' . $location );
 286+ $location = str_replace( '?enableImages=1', '', str_replace( '&enableImages=1', '', $wgRequest->getFullRequestURL() ) );
 287+ $location = str_replace( '&mfi=1', '', str_replace( '&mfi=0', '', $location ) );
 288+ $wgRequest->response()->header( 'Location: ' . $location . '&mfi=1' );
287289 }
288290
289291 self::$useFormat = $wgRequest->getText( 'useformat' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96027fix the workaround trunk and deployment differencespreilly19:11, 1 September 2011

Status & tagging log