r96027 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96026‎ | r96027 | r96028 >
Date:19:11, 1 September 2011
Author:preilly
Status:ok (Comments)
Tags:
Comment:
fix the workaround trunk and deployment differences
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/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' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r96028mft r96027preilly19:12, 1 September 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   20:57, 1 September 2011

Could probably use "TODO: hacky" type comments.

#Comment by Preilly (talk | contribs)   21:01, 1 September 2011

Yeah, that's true.

Status & tagging log