r95652 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95651‎ | r95652 | r95653 >
Date:09:00, 29 August 2011
Author:catrope
Status:ok
Tags:
Comment:
Protocol-relative URL fixes for CentralAuth and SiteMatrix:
* No need to expand the return value of WikiReference::getUrl() after r95961
* Like in r95961, switch ApiQueryGlobalUserInfo::getUrl() to pull 'wgCanonicalUrl' rather than 'wgServer' from $wgConf, and don't expand its return value
* Same for SiteMatrix::getUrl()
* Use getCanonicalUrl() for IRC line
Modified paths:
  • /trunk/extensions/CentralAuth/ApiQueryGlobalUserInfo.php (modified) (history)
  • /trunk/extensions/CentralAuth/CentralAuthUser.php (modified) (history)
  • /trunk/extensions/SiteMatrix/SiteMatrixApi.php (modified) (history)
  • /trunk/extensions/SiteMatrix/SiteMatrix_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SiteMatrix/SiteMatrixApi.php
@@ -57,7 +57,7 @@
5858
5959 $url = $matrix->getUrl( $lang, $site );
6060 $site_out = array(
61 - 'url' => wfExpandUrl( $url ),
 61+ 'url' => $url,
6262 'dbname' => $matrix->getDBName( $lang, $site ),
6363 'code' => $site,
6464 );
@@ -91,7 +91,7 @@
9292 $url = $matrix->getUrl( $lang, $site );
9393
9494 $wiki = array();
95 - $wiki['url'] = wfExpandUrl( $url );
 95+ $wiki['url'] = $url;
9696 $wiki['dbname'] = $matrix->getDBName( $lang, $site );
9797 $wiki['code'] = str_replace( '_', '-', $lang ) . ( $site != 'wiki' ? $site : '' );
9898
Index: trunk/extensions/SiteMatrix/SiteMatrix_body.php
@@ -135,7 +135,7 @@
136136 global $wgConf;
137137 $dbname = $this->getDBName( $minor, $major );
138138 $minor = str_replace( '_', '-', $minor );
139 - return $wgConf->get( 'wgServer', $dbname, $major,
 139+ return $wgConf->get( 'wgCanonicalServer', $dbname, $major,
140140 array( 'lang' => $minor, 'site' => $major ) );
141141 }
142142
Index: trunk/extensions/CentralAuth/ApiQueryGlobalUserInfo.php
@@ -82,7 +82,7 @@
8383
8484 $a = array(
8585 'wiki' => $dbname,
86 - 'url' => wfExpandUrl( $this->getUrl( $dbname ) ),
 86+ 'url' => $this->getUrl( $dbname ),
8787 'timestamp' => wfTimestamp( TS_ISO_8601, $account['attachedTimestamp'] ),
8888 'method' => $account['attachedMethod'],
8989 'editcount' => $account['editCount']
@@ -121,7 +121,7 @@
122122
123123 list( $major, $minor ) = $wgConf->siteFromDB( $dbname );
124124 $minor = str_replace( '_', '-', $minor );
125 - return $wgConf->get( 'wgServer', $dbname, $major,
 125+ return $wgConf->get( 'wgCanonicalServer', $dbname, $major,
126126 array( 'lang' => $minor, 'site' => $major ) );
127127 }
128128
Index: trunk/extensions/CentralAuth/CentralAuthUser.php
@@ -1188,8 +1188,7 @@
11891189 protected static function getIRCLine( $userpage, $wikiID ) {
11901190 $title = RecentChange::cleanupForIRC( $userpage->getPrefixedText() );
11911191 $wikiID = RecentChange::cleanupForIRC( $wikiID );
1192 - // FIXME: *HACK* should be getFullURL(), hacked for SSL madness
1193 - $url = $userpage->getInternalURL();
 1192+ $url = $userpage->getCanonicalURL();
11941193 $user = RecentChange::cleanupForIRC( $userpage->getText() );
11951194 # see http://www.irssi.org/documentation/formats for some colour codes. prefix is \003,
11961195 # no colour (\003) switches back to the term default

Follow-up revisions

RevisionCommit summaryAuthorDate
r959011.17wmf1: MFT HTTPS / prot rel URL fixes: r95627, r95651, r95652, r95653, r95...catrope19:15, 31 August 2011
r964851.18: MFT protocol-relative URL saga: r95014, r95016, r95017, r95627, r95651,...catrope20:14, 7 September 2011

Status & tagging log