Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/67586


Change subject: Generate "$wgServer" from SiteConfiguration using wikiid 
(dbname)
......................................................................

Generate "$wgServer" from SiteConfiguration using wikiid (dbname)

Change-Id: I3a90ae7f085e2c18c905b7023eee026b6468d469
---
M includes/user/Auth.php
1 file changed, 5 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll 
refs/changes/86/67586/1

diff --git a/includes/user/Auth.php b/includes/user/Auth.php
index ebf654a..270661c 100644
--- a/includes/user/Auth.php
+++ b/includes/user/Auth.php
@@ -278,7 +278,7 @@
         * @return Status
         */
        function requestLogin( $election ) {
-               global $wgRequest, $wgSecurePollScript;
+               global $wgRequest, $wgSecurePollScript, $wgConf;
 
                $urlParamNames = array( 'id', 'token', 'wiki', 'site', 'lang', 
'domain' );
                $vars = array();
@@ -293,18 +293,10 @@
                        $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
-                       // And 'wiki' and 'wikipedia' aren't the same blasted 
thing
-                       $matrix = new SiteMatrix();
-                       $server = $matrix->getUrl(
-                               $params['lang'],
-                               str_replace( 'wikipedia', 'wiki', 
$params['site'] )
-                       );
-                       $params['wgServer'] = $server;
-                       $vars["\$wgServer"] = $server;
-               }
+               $wgConf->loadFullData();
+               $server = $wgConf->get( 'wgServer', $params['wiki'] );
+               $params['wgServer'] = $server;
+               $vars["\$wgServer"] = $server;
 
                $url = $election->getProperty( 'remote-mw-script-path' );
                $url = strtr( $url, $vars );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a90ae7f085e2c18c905b7023eee026b6468d469
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>

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

Reply via email to