Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/86821
Change subject: Fixed zero.wikipedia.org to show red banner for no carrier case ...................................................................... Fixed zero.wikipedia.org to show red banner for no carrier case In case X-CS is net set, Special:Zero... will show red banner for zero subnet instead of redirecting to www.wikipedia.org Change-Id: Ia4d13d4a3875cc4300ea6ff35600d7ba2343f62c --- M includes/PageRenderingHooks.php 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroRatedMobileAccess refs/changes/21/86821/1 diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php index 472cc42..737740e 100644 --- a/includes/PageRenderingHooks.php +++ b/includes/PageRenderingHooks.php @@ -734,8 +734,12 @@ $toUrl = $this->request->getVal( 'to' ); if ( $toUrl === null || $from === null ) { // This is not a redirect, see if we need to redirect to the Main Page + $url = false; if ( $config === null ) { - $url = '//www.wikipedia.org'; + // Do not redirect if this is "zero.wikipedia.org" - need to show red warning + if ( !$this->isZeroSubdomain() ) { + $url = '//www.wikipedia.org'; + } } else { $info = self::getWikiInfo(); $dfltLang = $config['showLangs'][0]; @@ -746,8 +750,6 @@ $spcl = Title::makeTitle( NS_SPECIAL, 'ZeroRatedMobileAccess', '', $dfltLang ); $url = $spcl->getFullUrl(); $url = MobileContext::singleton()->getMobileUrl( $url ); - } else { - $url = false; } } if ( $url ) { -- To view, visit https://gerrit.wikimedia.org/r/86821 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia4d13d4a3875cc4300ea6ff35600d7ba2343f62c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess Gerrit-Branch: master Gerrit-Owner: Yurik <yu...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits