r98442 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98441‎ | r98442 | r98443 >
Date:20:28, 29 September 2011
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
fix for r98427 to avoid false positives on mobile domain removal
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -84,7 +84,7 @@
8585 }
8686
8787 class ExtMobileFrontend {
88 - const VERSION = '0.5.71';
 88+ const VERSION = '0.5.72';
8989
9090 /**
9191 * @var DOMDocument
@@ -240,9 +240,12 @@
241241 self::$disableImagesURL = $wgRequest->escapeAppendQuery( 'disableImages=1' );
242242 self::$enableImagesURL = $wgRequest->escapeAppendQuery( 'enableImages=1' );
243243 self::$disableMobileSiteURL = $wgRequest->escapeAppendQuery( 'mobileaction=disable_mobile_site' );
244 - self::$viewNormalSiteURL = str_replace( $wgMobileDomain, '.', $wgRequest->getFullRequestURL() );
245 - self::$viewNormalSiteURL = $this->removeQueryStringParameter( self::$viewNormalSiteURL, 'useformat' );
246 - self::$currentURL = $wgRequest->getFullRequestURL();
 244+ $parsedUrl = parse_url( $wgRequest->getFullRequestURL() );
 245+ $parsedUrl['host'] = str_replace( $wgMobileDomain, '.', $parsedUrl['host'] );
 246+ $parsedUrl['query'] = $this->removeQueryStringParameter( $parsedUrl['query'], 'useformat' );
 247+ $fragmentDelimiter = ( !empty( $parsedUrl['fragment'] ) ) ? '#' : '';
 248+ self::$viewNormalSiteURL = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . $parsedUrl['path'] . '?' . $parsedUrl['query'] . $fragmentDelimiter . $parsedUrl['fragment'];
 249+ self::$currentURL = $wgRequest->getFullRequestURL();
247250 self::$leaveFeedbackURL = $wgRequest->escapeAppendQuery( 'mobileaction=leave_feedback' );
248251
249252 $skin = $wgUser->getSkin();

Follow-up revisions

RevisionCommit summaryAuthorDate
r98445fix for r98442 to not use parse_url directlypreilly20:38, 29 September 2011
r98448mft r98427 r98442 r98445preilly21:02, 29 September 2011
r98449mft r98427 r98442 r98445preilly21:02, 29 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98427fix for bug 31240 - android browsers render content poorly when viewing deskt...preilly18:38, 29 September 2011

Comments

#Comment by G.Hagedorn (talk | contribs)   23:09, 30 September 2011

may need 1.18 tag?

#Comment by Preilly (talk | contribs)   23:11, 30 September 2011

It's now been added. Thanks!

Status & tagging log