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

Change subject: Make $wgServer available for use in remote-mw-script-path
......................................................................


Make $wgServer available for use in remote-mw-script-path

Change-Id: Ia18fadabf0c578df2d0ea833733a02f911bfad35
---
M includes/user/Auth.php
1 file changed, 10 insertions(+), 0 deletions(-)

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



diff --git a/includes/user/Auth.php b/includes/user/Auth.php
index de21225..85e0578 100644
--- a/includes/user/Auth.php
+++ b/includes/user/Auth.php
@@ -282,6 +282,7 @@
 
                $urlParamNames = array( 'id', 'token', 'wiki', 'site', 'lang', 
'domain' );
                $vars = array();
+               $params = array();
                foreach ( $urlParamNames as $name ) {
                        $value = $wgRequest->getVal( $name );
                        if ( !preg_match( '/^[\w.-]*$/', $value ) ) {
@@ -292,6 +293,15 @@
                        $vars["\$$name"] = $value;
                }
 
+               if ( class_exists( 'SiteMatrix' ) ) {
+                       // Get wgServer from $lang (minor) and $site (major) 
combo
+                       // Correct domain isn't guaranteed from 
$minor.$major.org
+                       $matrix = new SiteMatrix();
+                       $server = $matrix->getUrl( $params['lang'], 
$params['site'] );
+                       $params['wgServer'] = $server;
+                       $vars["\$wgServer"] = $server;
+               }
+
                $url = $election->getProperty( 'remote-mw-script-path' );
                $url = strtr( $url, $vars );
                if ( substr( $url, -1 ) != '/' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/67575
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia18fadabf0c578df2d0ea833733a02f911bfad35
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to