Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -265,8 +265,9 @@ |
266 | 266 | |
267 | 267 | if ( self::$disableImages == 1 ) { |
268 | 268 | $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' ); |
271 | 272 | } |
272 | 273 | |
273 | 274 | if ( self::$disableImages == 0 ) { |
— | — | @@ -281,8 +282,9 @@ |
282 | 283 | if ( $disableImages ) { |
283 | 284 | $wgRequest->response()->setcookie( 'disableImages', '' ); |
284 | 285 | } |
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' ); |
287 | 289 | } |
288 | 290 | |
289 | 291 | self::$useFormat = $wgRequest->getText( 'useformat' ); |