Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php |
— | — | @@ -1483,7 +1483,7 @@ |
1484 | 1484 | } |
1485 | 1485 | |
1486 | 1486 | public function checkUseFormatCookie() { |
1487 | | - global $wgRequest, $wgCookiePrefix; |
| 1487 | + global $wgRequest, $wgCookiePrefix, $wgScriptPath; |
1488 | 1488 | |
1489 | 1489 | if ( !isset( self::$useFormatCookieName )) { |
1490 | 1490 | self::$useFormatCookieName = $wgCookiePrefix . 'mf_useformat'; |
— | — | @@ -1497,9 +1497,15 @@ |
1498 | 1498 | $this->setUseFormat( $useFormatFromCookie ); |
1499 | 1499 | } |
1500 | 1500 | |
1501 | | - // set appropriate cookie if necessary |
1502 | | - if ( ( $useFormatFromCookie != 'mobile' && $useFormat == 'mobile' ) || |
1503 | | - ( $useFormatFromCookie != 'desktop' && $useFormat == 'desktop' ) ) { |
| 1501 | + // set appropriate cookie if necessary, ignoring certain URL patterns |
| 1502 | + // eg initial requests to a mobile-specific domain with no path. this |
| 1503 | + // is intended to avoid pitfalls for certain server configurations |
| 1504 | + // but should not get in the way of out-of-the-box configs |
| 1505 | + $reqUrl = $wgRequest->getRequestUrl(); |
| 1506 | + $urlsToIgnore = array( '/?useformat=mobile', $wgScriptPath . '/?useformat=mobile' ); |
| 1507 | + if ( ( ( $useFormatFromCookie != 'mobile' && $useFormat == 'mobile' ) || |
| 1508 | + ( $useFormatFromCookie != 'desktop' && $useFormat == 'desktop' ) ) && |
| 1509 | + !in_array( $reqUrl, $urlsToIgnore ) ) { |
1504 | 1510 | $this->setUseFormatCookie( $useFormat ); |
1505 | 1511 | } |
1506 | 1512 | } |
Property changes on: branches/wmf/1.19wmf1/extensions/MobileFrontend |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1507 | 1513 | Merged /trunk/extensions/MobileFrontend:r114409 |