Dr0ptp4kt has uploaded a new change for review.
https://gerrit.wikimedia.org/r/86887
Change subject: Redirect mdot subdomain with no or disabled config to mdot
homepage.
......................................................................
Redirect mdot subdomain with no or disabled config to mdot homepage.
* For access attempts against Special:ZeroRatedMobileAccess
* Access attempts against zerodot continue to present red warning.
Change-Id: I444302b440242c9c1791c4da94fe98283453740f
---
M includes/PageRenderingHooks.php
1 file changed, 4 insertions(+), 2 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroRatedMobileAccess
refs/changes/87/86887/1
diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php
index 737740e..0b4479b 100644
--- a/includes/PageRenderingHooks.php
+++ b/includes/PageRenderingHooks.php
@@ -735,13 +735,15 @@
if ( $toUrl === null || $from === null ) {
// This is not a redirect, see if we need to redirect
to the Main Page
$url = false;
+ $info = self::getWikiInfo();
if ( $config === null ) {
// Do not redirect if this is
"zero.wikipedia.org" - need to show red warning
if ( !$this->isZeroSubdomain() ) {
- $url = '//www.wikipedia.org';
+ $currentLang = $info[1];
+ $url = $this->getMainPage( $currentLang
);
}
} else {
- $info = self::getWikiInfo();
+
$dfltLang = $config['showLangs'][0];
if ( !$config['showZeroPage'] ) {
$url = $this->getMainPage( $dfltLang );
--
To view, visit https://gerrit.wikimedia.org/r/86887
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I444302b440242c9c1791c4da94fe98283453740f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: Dr0ptp4kt <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits