jenkins-bot has submitted this change and it was merged.

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, 5 insertions(+), 3 deletions(-)

Approvals:
  Kaldari: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php
index 737740e..753dfe1 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 
);
                                }
+                               // But, do not redirect if this is 
"zero.wikipedia.org" - need to show red warning
                        } 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: merged
Gerrit-Change-Id: I444302b440242c9c1791c4da94fe98283453740f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess
Gerrit-Branch: master
Gerrit-Owner: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to