Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -265,10 +265,10 @@ |
266 | 266 | |
267 | 267 | if ( self::$disableImages == 1 ) { |
268 | 268 | $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') ) ); |
270 | 270 | $wgRequest->response()->header( 'Location: ' . $location ); |
271 | 271 | } |
272 | | - |
| 272 | + |
273 | 273 | if ( self::$disableImages == 0 ) { |
274 | 274 | $disableImages = $wgRequest->getCookie( 'disableImages' ); |
275 | 275 | if ( $disableImages ) { |
— | — | @@ -280,12 +280,11 @@ |
281 | 281 | $disableImages = $wgRequest->getCookie( 'disableImages' ); |
282 | 282 | if ( $disableImages ) { |
283 | 283 | $wgRequest->response()->setcookie( 'disableImages', '' ); |
284 | | - $location = str_replace( 'enableImages=1', '', $wgRequest->getRequestURL() ); |
285 | | - $wgRequest->response()->header( 'Location: ' . $location ); |
286 | 284 | } |
| 285 | + $location = str_replace( '?enableImages=1', '', str_replace( '&enableImages=1', '', $wgRequest->appendQuery('mfi=1') ) ); |
| 286 | + $wgRequest->response()->header( 'Location: ' . $location ); |
287 | 287 | } |
288 | 288 | |
289 | | - |
290 | 289 | self::$useFormat = $wgRequest->getText( 'useformat' ); |
291 | 290 | self::$format = $wgRequest->getText( 'format' ); |
292 | 291 | self::$requestedSegment = $wgRequest->getText( 'seg', 0 ); |