r96485 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96484‎ | r96485 | r96486 >
Date:20:14, 7 September 2011
Author:catrope
Status:ok
Tags:
Comment:
1.18: MFT protocol-relative URL saga: r95014, r95016, r95017, r95627, r95651, r95652, r95653, r95656, r95659, r95663, r95855, r95899, r96180, r96228, r96286, r96297
Modified paths:
  • /branches/REL1_18/extensions/AbuseFilter/AbuseFilter.class.php (modified) (history)
  • /branches/REL1_18/extensions/ActiveAbstract/AbstractFilter.php (modified) (history)
  • /branches/REL1_18/extensions/ActiveAbstract/GoogleCoopFilter.php (modified) (history)
  • /branches/REL1_18/extensions/CentralAuth/ApiQueryGlobalUserInfo.php (modified) (history)
  • /branches/REL1_18/extensions/CentralAuth/CentralAuthUser.php (modified) (history)
  • /branches/REL1_18/extensions/CentralNotice/CentralNotice.php (modified) (history)
  • /branches/REL1_18/extensions/CodeReview/backend/CodeRevision.php (modified) (history)
  • /branches/REL1_18/extensions/CodeReview/tests/CodeReviewTest.php (modified) (history)
  • /branches/REL1_18/extensions/CodeReview/ui/CodeRevisionCommitter.php (modified) (history)
  • /branches/REL1_18/extensions/Collection/Collection.body.php (modified) (history)
  • /branches/REL1_18/extensions/Collection/Collection.php (modified) (history)
  • /branches/REL1_18/extensions/ContributionTracking/ContributionTracking_body.php (modified) (history)
  • /branches/REL1_18/extensions/DoubleWiki/DoubleWiki_body.php (modified) (history)
  • /branches/REL1_18/extensions/EmailCapture/api/ApiEmailCapture.php (modified) (history)
  • /branches/REL1_18/extensions/GlobalUsage/ApiQueryGlobalUsage.php (modified) (history)
  • /branches/REL1_18/extensions/LiquidThreads/classes/NewMessagesController.php (modified) (history)
  • /branches/REL1_18/extensions/LiquidThreads/classes/View.php (modified) (history)
  • /branches/REL1_18/extensions/OAI/OAIRepo_body.php (modified) (history)
  • /branches/REL1_18/extensions/OpenSearchXml/ApiOpenSearchXml.php (modified) (history)
  • /branches/REL1_18/extensions/SecurePoll/includes/entities/Election.php (modified) (history)
  • /branches/REL1_18/extensions/SecurePoll/includes/user/Auth.php (modified) (history)
  • /branches/REL1_18/extensions/SiteMatrix/SiteMatrixApi.php (modified) (history)
  • /branches/REL1_18/extensions/SiteMatrix/SiteMatrix_body.php (modified) (history)
  • /branches/REL1_18/extensions/SpamBlacklist/SpamBlacklist_body.php (modified) (history)
  • /branches/REL1_18/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/REL1_18/phase3/includes/ExternalEdit.php (modified) (history)
  • /branches/REL1_18/phase3/includes/Feed.php (modified) (history)
  • /branches/REL1_18/phase3/includes/HttpFunctions.php (modified) (history)
  • /branches/REL1_18/phase3/includes/ProxyTools.php (modified) (history)
  • /branches/REL1_18/phase3/includes/Title.php (modified) (history)
  • /branches/REL1_18/phase3/includes/WikiMap.php (modified) (history)
  • /branches/REL1_18/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialPasswordReset.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/generateSitemap.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/purgeList.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/extensions/LiquidThreads/classes/View.php
@@ -161,7 +161,13 @@
162162
163163 return $title->getFullURL( $query );
164164 }
 165+
 166+ static function linkInContextCanonicalURL( $thread, $contextType = 'page' ) {
 167+ list( $title, $query ) = self::linkInContextData( $thread, $contextType );
165168
 169+ return $title->getCanonicalURL( $query );
 170+ }
 171+
166172 static function diffQuery( $thread, $revision ) {
167173 $changed_thread = $revision->getChangeObject();
168174 $curr_rev_id = $changed_thread->rootRevision();
Index: branches/REL1_18/extensions/LiquidThreads/classes/NewMessagesController.php
@@ -285,7 +285,7 @@
286286 global $wgPasswordSender;
287287 $link_title = clone $t->getTitle();
288288 $link_title->setFragment( '#' . $t->getAnchorName() );
289 - $permalink = LqtView::linkInContextFullURL( $t );
 289+ $permalink = LqtView::linkInContextCanonicalURL( $t );
290290 $talkPage = $t->getTitle()->getPrefixedText();
291291 $from = new MailAddress( $wgPasswordSender, 'WikiAdmin' );
292292 $threadSubject = $t->subject();
Index: branches/REL1_18/extensions/OAI/OAIRepo_body.php
@@ -544,7 +544,7 @@
545545
546546 function baseUrl() {
547547 $title =& SpecialPage::getTitleFor( 'OAIRepository' );
548 - return $title->getFullUrl();
 548+ return $title->getCanonicalUrl();
549549 }
550550
551551 function earliestDatestamp() {
@@ -828,7 +828,7 @@
829829 oaiTag( 'dc:language', array(), $wgContLanguageCode ) . "\n" .
830830 oaiTag( 'dc:type', array(), 'Text' ) . "\n" .
831831 oaiTag( 'dc:format', array(), $wgMimeType ) . "\n" .
832 - oaiTag( 'dc:identifier', array(), $title->getFullUrl() ) . "\n" .
 832+ oaiTag( 'dc:identifier', array(), $title->getCanonicalUrl() ) . "\n" .
833833 oaiTag( 'dc:contributor', array(), $this->_row->rev_user_text ) . "\n" .
834834 oaiTag( 'dc:date', array(), oaiDatestamp( $this->getDatestamp() ) ) . "\n" .
835835 "</oai_dc:dc>\n";
Index: branches/REL1_18/extensions/SpamBlacklist/SpamBlacklist_body.php
@@ -35,7 +35,7 @@
3636 }
3737 }
3838
39 - $thisHttp = $title->getFullUrl( 'action=raw' );
 39+ $thisHttp = wfExpandUrl( $title->getFullUrl( 'action=raw' ), PROTO_HTTP );
4040 $thisHttpRegex = '/^' . preg_quote( $thisHttp, '/' ) . '(?:&.*)?$/';
4141
4242 foreach( $this->files as $fileName ) {
Index: branches/REL1_18/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: branches/REL1_18/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: branches/REL1_18/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: branches/REL1_18/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
Index: branches/REL1_18/extensions/DoubleWiki/DoubleWiki_body.php
@@ -74,7 +74,7 @@
7575 if( $cachedText ) {
7676 $text = $cachedText;
7777 } else {
78 - $url = $nt->getFullURL();
 78+ $url = $nt->getCanonicalURL();
7979 $myURL = $out->getTitle()->getLocalURL();
8080 $languageName = $wgContLang->getLanguageName( $iw );
8181 $myLanguage = $wgLang->getLanguageName( $wgContLang->getCode() );
Index: branches/REL1_18/extensions/SecurePoll/includes/entities/Election.php
@@ -377,7 +377,7 @@
378378 Xml::element( 'auth', array(), 'local' ) . "\n" .
379379 Xml::element( 'property',
380380 array( 'name' => 'jump-url' ),
381 - $this->context->getSpecialTitle()->getFullURL()
 381+ $this->context->getSpecialTitle()->getCanonicalUrl()
382382 ) . "\n" .
383383 Xml::element( 'property',
384384 array( 'name' => 'jump-id' ),
Index: branches/REL1_18/extensions/SecurePoll/includes/user/Auth.php
@@ -205,7 +205,7 @@
206206 'name' => $user->getName(),
207207 'type' => 'local',
208208 'domain' => preg_replace( '!.*/(.*)$!', '$1', $wgServer ),
209 - 'url' => $user->getUserPage()->getFullURL(),
 209+ 'url' => $user->getUserPage()->getCanonicalURL(),
210210 'properties' => array(
211211 'wiki' => wfWikiID(),
212212 'blocked' => $user->isBlocked(),
Index: branches/REL1_18/extensions/ContributionTracking/ContributionTracking_body.php
@@ -93,7 +93,7 @@
9494 $returnText = $wgRequest->getText( 'returnto', "Donate-thanks/$language" );
9595 $returnTitle = Title::newFromText( $returnText );
9696 if( $returnTitle ) {
97 - $returnto = $returnTitle->getFullUrl();
 97+ $returnto = wfExpandUrl( $returnTitle->getFullUrl(), PROTO_CURRENT );
9898 } else {
9999 $returnto = $wgContributionTrackingReturnToURLDefault . "/$language";
100100 }
Index: branches/REL1_18/extensions/Collection/Collection.php
@@ -216,12 +216,12 @@
217217 $r = new AjaxResponse();
218218 if ( $redirect ) {
219219 $title = Title::newFromText( $redirect );
220 - $redirecturl = $title->getFullURL();
 220+ $redirecturl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
221221 $r->setResponseCode( 302 );
222222 header( 'Location: ' . $redirecturl );
223223 } else {
224224 $title = SpecialPage::getTitleFor( 'Book' );
225 - $redirecturl = $title->getFullURL();
 225+ $redirecturl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
226226 $r->setContentType( 'application/json' );
227227 $r->addText( $json->encode( array( 'redirect_url' => $redirecturl ) ) );
228228 }
Index: branches/REL1_18/extensions/Collection/Collection.body.php
@@ -577,7 +577,7 @@
578578 'revision' => strval( $oldid ),
579579 'latest' => strval( $latest ),
580580 'timestamp' => wfTimestamp( TS_UNIX, $revision->mTimestamp ),
581 - 'url' => $title->getFullURL(),
 581+ 'url' => $title->getCanonicalURL(),
582582 'currentVersion' => $currentVersion,
583583 );
584584
@@ -762,7 +762,7 @@
763763 'latest' => $latest,
764764 'revision' => $oldid,
765765 'timestamp' => wfTimestamp( TS_UNIX, $revision->mTimestamp ),
766 - 'url' => $articleTitle->getFullURL(),
 766+ 'url' => $articleTitle->getCanonicalURL(),
767767 'currentVersion' => $currentVersion,
768768 );
769769 if ( $displayTitle ) {
@@ -952,7 +952,7 @@
953953
954954 $response = self::mwServeCommand( 'render', array(
955955 'metabook' => $this->buildJSONCollection( $collection ),
956 - 'base_url' => wfExpandUrl( $wgScriptPath ),
 956+ 'base_url' => wfExpandUrl( $wgScriptPath, PROTO_CURRENT ),
957957 'script_extension' => $wgScriptExtension,
958958 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ),
959959 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ),
@@ -985,7 +985,7 @@
986986
987987 $response = self::mwServeCommand( 'render', array(
988988 'collection_id' => $collectionID,
989 - 'base_url' => wfExpandUrl( $wgScriptPath ),
 989+ 'base_url' => wfExpandUrl( $wgScriptPath, PROTO_CURRENT ),
990990 'script_extension' => $wgScriptExtension,
991991 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ),
992992 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ),
@@ -1060,7 +1060,7 @@
10611061 $wgOut->setPageTitle( wfMsg( 'coll-rendering_finished_title' ) );
10621062
10631063 $template = new CollectionFinishedTemplate();
1064 - $template->set( 'download_url', wfExpandUrl( SkinTemplate::makeSpecialUrl( 'Book', 'bookcmd=download&' . $query ) ) );
 1064+ $template->set( 'download_url', wfExpandUrl( SkinTemplate::makeSpecialUrl( 'Book', 'bookcmd=download&' . $query ), PROTO_CURRENT ) );
10651065 $template->set( 'is_cached', $wgRequest->getVal( 'is_cached' ) );
10661066 $template->set( 'query', $query );
10671067 $template->set( 'return_to', $return_to );
@@ -1150,7 +1150,7 @@
11511151
11521152 $response = self::mwServeCommand( 'zip_post', array(
11531153 'metabook' => $this->buildJSONCollection( $collection ),
1154 - 'base_url' => wfExpandUrl( $wgScriptPath ),
 1154+ 'base_url' => wfExpandUrl( $wgScriptPath, PROTO_CURRENT ),
11551155 'script_extension' => $wgScriptExtension,
11561156 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ),
11571157 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ),
@@ -1271,7 +1271,7 @@
12721272 curl_setopt( $c, CURLOPT_HTTPHEADER, array( 'Expect:' ) );
12731273 curl_setopt( $c, CURLOPT_HEADER, false );
12741274 if ( is_object( $wgTitle ) ) {
1275 - curl_setopt( $c, CURLOPT_REFERER, $wgTitle->getFullURL() );
 1275+ curl_setopt( $c, CURLOPT_REFERER, wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) );
12761276 }
12771277 if ( $timeout ) {
12781278 curl_setopt( $c, CURLOPT_TIMEOUT, $wgHTTPTimeout );
Index: branches/REL1_18/extensions/GlobalUsage/ApiQueryGlobalUsage.php
@@ -62,8 +62,7 @@
6363 'wiki' => WikiMap::getWikiName( $wiki )
6464 );
6565 if ( isset( $prop['url'] ) ) {
66 - $result['url'] = wfExpandUrl(
67 - WikiMap::getForeignUrl( $item['wiki'], $title ) );
 66+ $result['url'] = WikiMap::getForeignUrl( $item['wiki'], $title );
6867 }
6968 if ( isset( $prop['pageid'] ) ) {
7069 $result['pageid'] = $item['id'];
Index: branches/REL1_18/extensions/EmailCapture/api/ApiEmailCapture.php
@@ -33,8 +33,8 @@
3434 // Send auto-response
3535 global $wgEmailCaptureSendAutoResponse, $wgEmailCaptureAutoResponse;
3636 $title = SpecialPage::getTitleFor( 'EmailCapture' );
37 - $link = $title->getFullURL();
38 - $fullLink = $title->getFullURL( array( 'verify' => $code ) );
 37+ $link = $title->getCanonicalURL();
 38+ $fullLink = $title->getCanonicalURL( array( 'verify' => $code ) );
3939 if ( $wgEmailCaptureSendAutoResponse ) {
4040 UserMailer::send(
4141 new MailAddress( $params['email'] ),
Index: branches/REL1_18/extensions/CodeReview/backend/CodeRevision.php
@@ -439,13 +439,13 @@
440440 );
441441
442442 // Get repo and build comment title (for url)
443 - $url = $this->getFullUrl();
 443+ $url = $this->getCanonicalUrl();
444444
445445 foreach ( $res as $row ) {
446446 $revision = CodeRevision::newFromRow( $this->repo, $row );
447447 $users = $revision->getCommentingUsers();
448448
449 - $rowUrl = $revision->getFullUrl();
 449+ $rowUrl = $revision->getCanonicalUrl();
450450
451451 $revisionAuthor = $revision->getWikiUser();
452452
@@ -623,7 +623,7 @@
624624 $commentId = $dbw->insertId();
625625 $dbw->commit();
626626
627 - $url = $this->getFullUrl( $commentId );
 627+ $url = $this->getCanonicalUrl( $commentId );
628628
629629 $this->sendCommentToUDP( $commentId, $text, $url );
630630
@@ -1238,10 +1238,12 @@
12391239 }
12401240
12411241 /**
 1242+ * Get the canonical URL of a revision. Constructs a Title for this revision
 1243+ * along the lines of [[Special:Code/RepoName/12345#c678]] and calls getCanonicalUrl().
12421244 * @param string $commentId
12431245 * @return \type
12441246 */
1245 - public function getFullUrl( $commentId = 0 ) {
 1247+ public function getCanonicalUrl( $commentId = 0 ) {
12461248 $title = SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/' . $this->id );
12471249
12481250 # Append comment id if not null, empty string or zero
@@ -1249,7 +1251,7 @@
12501252 $title->setFragment( "#c{$commentId}" );
12511253 }
12521254
1253 - return $title->getFullUrl();
 1255+ return $title->getCanonicalUrl();
12541256 }
12551257
12561258 /**
@@ -1263,7 +1265,7 @@
12641266
12651267 if( $wgCodeReviewUDPAddress ) {
12661268 if( is_null( $url ) ) {
1267 - $url = $this->getFullUrl( $commentId );
 1269+ $url = $this->getCanonicalUrl( $commentId );
12681270 }
12691271
12701272 $line = wfMsg( 'code-rev-message' ) . " \00314(" . $this->repo->getName() .
@@ -1282,7 +1284,7 @@
12831285 global $wgCodeReviewUDPAddress, $wgCodeReviewUDPPort, $wgCodeReviewUDPPrefix, $wgUser;
12841286
12851287 if( $wgCodeReviewUDPAddress ) {
1286 - $url = $this->getFullUrl();
 1288+ $url = $this->getCanonicalUrl();
12871289
12881290 $line = wfMsg( 'code-rev-status' ) . " \00314(" . $this->repo->getName() .
12891291 ")\00303 " . RecentChange::cleanupForIRC( $wgUser->getName() ) . "\003 " .
Property changes on: branches/REL1_18/extensions/CodeReview/backend/CodeRevision.php
___________________________________________________________________
Modified: svn:mergeinfo
12901292 Merged /trunk/extensions/CodeReview/backend/CodeRevision.php:r95014,95016-95017,95627,95651-95653,95656,95659,95663,95855,95899,96180,96228,96286,96297
Index: branches/REL1_18/extensions/CodeReview/tests/CodeReviewTest.php
@@ -41,7 +41,7 @@
4242 // $this->assertEquals( '', $formatter->link( '' ) );
4343 }
4444
45 - public function testCommentFullUrl() {
 45+ public function testCommentCanonicalUrl() {
4646 # Fixture:
4747 $repo = $this->createRepo();
4848 $cr = CodeRevision::newFromSvn( $repo, array(
@@ -54,14 +54,14 @@
5555 );
5656
5757 # Find out our revision root URL
58 - $baseUrl = SpecialPage::getTitleFor( 'Code', $repo->getName().'/305' )->getFullUrl();
 58+ $baseUrl = SpecialPage::getTitleFor( 'Code', $repo->getName().'/305' )->getCanonicalUrl();
5959
6060 # Test revision URL with various comment id:
61 - $this->assertEquals( $baseUrl, $cr->getFullUrl( '' ) );
62 - $this->assertEquals( $baseUrl, $cr->getFullUrl( 0 ) );
63 - $this->assertEquals( $baseUrl, $cr->getFullUrl( null ) );
64 - $this->assertEquals( $baseUrl, $cr->getFullUrl( "0" ) );
65 - $this->assertEquals( $baseUrl . '#c777', $cr->getFullUrl( 777 ) );
66 - $this->assertEquals( $baseUrl . '#c777', $cr->getFullUrl( "777" ) );
 61+ $this->assertEquals( $baseUrl, $cr->getCanonicalUrl( '' ) );
 62+ $this->assertEquals( $baseUrl, $cr->getCanonicalUrl( 0 ) );
 63+ $this->assertEquals( $baseUrl, $cr->getCanonicalUrl( null ) );
 64+ $this->assertEquals( $baseUrl, $cr->getCanonicalUrl( "0" ) );
 65+ $this->assertEquals( $baseUrl . '#c777', $cr->getCanonicalUrl( 777 ) );
 66+ $this->assertEquals( $baseUrl . '#c777', $cr->getCanonicalUrl( "777" ) );
6767 }
6868 }
Property changes on: branches/REL1_18/extensions/CodeReview/tests/CodeReviewTest.php
___________________________________________________________________
Modified: svn:mergeinfo
6969 Merged /trunk/extensions/CodeReview/tests/CodeReviewTest.php:r95014,95016-95017,95627,95651-95653,95656,95659,95663,95855,95899,96180,96228,96286,96297
Index: branches/REL1_18/extensions/CodeReview/ui/CodeRevisionCommitter.php
@@ -117,7 +117,7 @@
118118 $dbw->commit();
119119
120120 if ( $statusChanged || $commentAdded ) {
121 - $url = $this->mRev->getFullUrl( $commentId );
 121+ $url = $this->mRev->getCanonicalUrl( $commentId );
122122 if ( $statusChanged && $commentAdded ) {
123123 $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj4', 'codereview-email-body4',
124124 $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(),
Index: branches/REL1_18/extensions/CentralNotice/CentralNotice.php
@@ -187,7 +187,7 @@
188188
189189 function efCentralNoticeGeoLoader( $skin, &$text ) {
190190 // Insert the geo IP lookup
191 - $text .= '<script type="text/javascript" src="http://geoiplookup.wikimedia.org/"></script>';
 191+ $text .= '<script type="text/javascript" src="//geoiplookup.wikimedia.org/"></script>';
192192 return true;
193193 }
194194
Index: branches/REL1_18/extensions/OpenSearchXml/ApiOpenSearchXml.php
@@ -122,11 +122,11 @@
123123 $item = array();
124124 $item['Text']['*'] = $title->getPrefixedText();
125125 $item['Description']['*'] = $extract;
126 - $item['Url']['*'] = $title->getFullUrl();
 126+ $item['Url']['*'] = wfExpandUrl( $title->getFullUrl(), PROTO_CURRENT );
127127 if( $image ) {
128128 $thumb = $image->transform( array( 'width' => 50, 'height' => 50 ), 0 );
129129 $item['Image'] = array(
130 - 'source' => wfExpandUrl( $thumb->getUrl() ),
 130+ 'source' => wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ),
131131 //alt
132132 'width' => $thumb->getWidth(),
133133 'height' => $thumb->getHeight() );
Index: branches/REL1_18/extensions/AbuseFilter/AbuseFilter.class.php
@@ -1705,12 +1705,12 @@
17061706 static function modifyActionText( $page, $type, $title, $sk, $args ) {
17071707 list( $history_id, $filter_id ) = $args;
17081708
1709 - $filter_link = $sk ? $sk->link( $title ) : $title->getFullURL();
 1709+ $filter_link = $sk ? $sk->link( $title ) : $title->getCanonicalURL();
17101710
17111711 $details_title = SpecialPage::getTitleFor( 'AbuseFilter', "history/$filter_id/diff/prev/$history_id" );
17121712 $details_text = wfMsgExt( 'abusefilter-log-detailslink', 'parseinline' );
17131713 $details_link =
1714 - $sk ? $sk->link( $details_title, $details_text ) : $details_title->getFullURL();
 1714+ $sk ? $sk->link( $details_title, $details_text ) : $details_title->getCanonicalURL();
17151715
17161716 return wfMsgExt( 'abusefilter-log-entry-modify',
17171717 array( 'parseinline', 'replaceafter' ), array( $filter_link, $details_link ) );
Index: branches/REL1_18/extensions/ActiveAbstract/AbstractFilter.php
@@ -55,7 +55,7 @@
5656
5757 $xml = "<doc>\n";
5858 $xml .= Xml::element( 'title', null, $this->_variant( $title ) ) . "\n";
59 - $xml .= Xml::element( 'url', null, $this->title->getFullUrl() ) . "\n";
 59+ $xml .= Xml::element( 'url', null, $this->title->getCanonicalUrl() ) . "\n";
6060
6161 // add abstract and links when we have revision data...
6262 $this->revision = null;
@@ -216,7 +216,7 @@
217217 $stripped = $this->_stripMarkup( $inside ); // strip internal markup and <h[1-6]>
218218 $header = UtfNormal::cleanUp( $stripped );
219219 $anchor = EditPage::sectionAnchor( $header );
220 - $url = $this->title->getFullUrl() . $anchor;
 220+ $url = $this->title->getCanonicalUrl() . $anchor;
221221 $headers[$header] = $url;
222222 }
223223 return $headers;
@@ -239,7 +239,7 @@
240240 $links = array();
241241 while ( $row = $dbr->fetchObject( $result ) ) {
242242 $category = Title::makeTitle( NS_CATEGORY, $row->cl_to );
243 - $links[$category->getText()] = $category->getFullUrl();
 243+ $links[$category->getText()] = $category->getCanonicalUrl();
244244 }
245245 $dbr->freeResult( $result );
246246
Index: branches/REL1_18/extensions/ActiveAbstract/GoogleCoopFilter.php
@@ -72,7 +72,7 @@
7373 $xml .= ' ' . Xml::element( 'Output', array( 'name' => 'title' ),
7474 $wgSitename . ':' . $this->title->getPrefixedText() ) . "\n";
7575 $xml .= ' ' . Xml::element( 'Output', array( 'name' => 'more_url' ),
76 - $this->title->getFullUrl() ) . "\n";
 76+ $this->title->getCanonicalUrl() ) . "\n";
7777
7878 // add abstract and links when we have revision data...
7979 $this->revision = null;
Index: branches/REL1_18/phase3/maintenance/generateSitemap.php
@@ -298,7 +298,7 @@
299299 }
300300 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
301301 $date = wfTimestamp( TS_ISO_8601, $row->page_touched );
302 - $entry = $this->fileEntry( $title->getFullURL(), $date, $this->priority( $namespace ) );
 302+ $entry = $this->fileEntry( $title->getCanonicalURL(), $date, $this->priority( $namespace ) );
303303 $length += strlen( $entry );
304304 $this->write( $this->file, $entry );
305305 // generate pages for language variants
@@ -306,7 +306,7 @@
307307 $variants = $wgContLang->getVariants();
308308 foreach ( $variants as $vCode ) {
309309 if ( $vCode == $wgContLang->getCode() ) continue; // we don't want default variant
310 - $entry = $this->fileEntry( $title->getFullURL( '', $vCode ), $date, $this->priority( $namespace ) );
 310+ $entry = $this->fileEntry( $title->getCanonicalURL( '', $vCode ), $date, $this->priority( $namespace ) );
311311 $length += strlen( $entry );
312312 $this->write( $this->file, $entry );
313313 }
@@ -456,7 +456,7 @@
457457
458458 $this->limit = array(
459459 strlen( $this->openFile() ),
460 - strlen( $this->fileEntry( $title->getFullUrl(), wfTimestamp( TS_ISO_8601, wfTimestamp() ), $this->priority( $namespace ) ) ),
 460+ strlen( $this->fileEntry( $title->getCanonicalURL(), wfTimestamp( TS_ISO_8601, wfTimestamp() ), $this->priority( $namespace ) ) ),
461461 strlen( $this->closeFile() )
462462 );
463463 }
Index: branches/REL1_18/phase3/maintenance/purgeList.php
@@ -52,7 +52,7 @@
5353 } elseif ( $page !== '' ) {
5454 $title = Title::newFromText( $page );
5555 if ( $title ) {
56 - $url = $title->getFullUrl();
 56+ $url = $title->getInternalUrl();
5757 $this->output( "$url\n" );
5858 $urls[] = $url;
5959 if ( $this->getOption( 'purge' ) ) {
@@ -105,7 +105,7 @@
106106 $urls = array();
107107 foreach( $result as $row ) {
108108 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
109 - $url = $title->getFullUrl();
 109+ $url = $title->getInternalUrl();
110110 $urls[] = $url;
111111 }
112112
Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18
@@ -611,6 +611,8 @@
612612 * Removed legacy wgAjaxWatch javascript global object, no longer in use.
613613 * (bug 28556) Upload support for MacBinary files has been removed (Used by
614614 Internet Explorer 5 for Mac OS 9)
 615+* On wiki farm setups using $wgConf, 'wgCanonicalServer' is now expected to be
 616+ set for all wikis. This was already the case for 'wgServer'.
615617
616618 == Compatibility ==
617619
Property changes on: branches/REL1_18/phase3/RELEASE-NOTES-1.18
___________________________________________________________________
Modified: svn:mergeinfo
618620 Merged /trunk/phase3/RELEASE-NOTES-1.18:r95014,95016-95017,95627,95651-95653,95656,95659,95663,95855,95899,96180,96228,96286,96297
Index: branches/REL1_18/phase3/includes/ProxyTools.php
@@ -164,7 +164,7 @@
165165 if ( !$skip ) {
166166 $title = SpecialPage::getTitleFor( 'Blockme' );
167167 $iphash = md5( $ip . $wgProxyKey );
168 - $url = $title->getFullURL( 'ip='.$iphash );
 168+ $url = wfExpandUrl( $title->getFullURL( 'ip='.$iphash ), PROTO_HTTP );
169169
170170 foreach ( $wgProxyPorts as $port ) {
171171 $params = implode( ' ', array(
Index: branches/REL1_18/phase3/includes/diff/DifferenceEngine.php
@@ -186,14 +186,14 @@
187187 # we'll use the application/x-external-editor interface to call
188188 # an external diff tool like kompare, kdiff3, etc.
189189 if ( $wgUseExternalEditor && $wgUser->getOption( 'externaldiff' ) ) {
190 - global $wgServer, $wgScript, $wgLang;
 190+ global $wgCanonicalServer, $wgScript, $wgLang;
191191 $wgOut->disable();
192192 header ( "Content-type: application/x-external-editor; charset=UTF-8" );
193 - $url1 = $this->mTitle->getFullURL( array(
 193+ $url1 = $this->mTitle->getCanonical( array(
194194 'action' => 'raw',
195195 'oldid' => $this->mOldid
196196 ) );
197 - $url2 = $this->mTitle->getFullURL( array(
 197+ $url2 = $this->mTitle->getCanonical( array(
198198 'action' => 'raw',
199199 'oldid' => $this->mNewid
200200 ) );
@@ -202,7 +202,7 @@
203203 [Process]
204204 Type=Diff text
205205 Engine=MediaWiki
206 - Script={$wgServer}{$wgScript}
 206+ Script={$wgCanonicalServer}{$wgScript}
207207 Special namespace={$special}
208208
209209 [File]
Index: branches/REL1_18/phase3/includes/ExternalEdit.php
@@ -45,7 +45,7 @@
4646 * Output the information for the external editor
4747 */
4848 public function edit() {
49 - global $wgOut, $wgScript, $wgScriptPath, $wgServer, $wgLang;
 49+ global $wgOut, $wgScript, $wgScriptPath, $wgCanonicalServer, $wgLang;
5050 $wgOut->disable();
5151 header( 'Content-type: application/x-external-editor; charset=utf-8' );
5252 header( 'Cache-control: no-cache' );
@@ -56,11 +56,11 @@
5757 if( $this->mode == "file" ) {
5858 $type = "Edit file";
5959 $image = wfLocalFile( $this->title );
60 - $url = $image->getFullURL();
 60+ $url = $image->getCanonicalURL();
6161 $extension = $image->getExtension();
6262 } else {
6363 $type = "Edit text";
64 - $url = $this->title->getFullURL(
 64+ $url = $this->title->getCanonicalURL(
6565 array( 'action' => 'edit', 'internaledit' => 'true' ) );
6666 # *.wiki file extension is used by some editors for syntax
6767 # highlighting, so we follow that convention
@@ -76,8 +76,8 @@
7777 [Process]
7878 Type=$type
7979 Engine=MediaWiki
80 -Script={$wgServer}{$wgScript}
81 -Server={$wgServer}
 80+Script={$wgCanonicalServer}{$wgScript}
 81+Server={$wgCanonicalServer}
8282 Path={$wgScriptPath}
8383 Special namespace=$special
8484
Index: branches/REL1_18/phase3/includes/Feed.php
@@ -308,7 +308,7 @@
309309 ?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
310310 <channel>
311311 <title><?php print $this->getTitle() ?></title>
312 - <link><?php print $this->getUrl() ?></link>
 312+ <link><?php print wfExpandUrl( $this->getUrl(), PROTO_CURRENT ) ?></link>
313313 <description><?php print $this->getDescription() ?></description>
314314 <language><?php print $this->getLanguage() ?></language>
315315 <generator>MediaWiki <?php print $wgVersion ?></generator>
@@ -324,12 +324,12 @@
325325 ?>
326326 <item>
327327 <title><?php print $item->getTitle() ?></title>
328 - <link><?php print $item->getUrl() ?></link>
 328+ <link><?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ) ?></link>
329329 <guid<?php if( !$item->RSSIsPermalink ) print ' isPermaLink="false"' ?>><?php print $item->getUniqueId() ?></guid>
330330 <description><?php print $item->getDescription() ?></description>
331331 <?php if( $item->getDate() ) { ?><pubDate><?php print $this->formatTime( $item->getDate() ) ?></pubDate><?php } ?>
332332 <?php if( $item->getAuthor() ) { ?><dc:creator><?php print $item->getAuthor() ?></dc:creator><?php }?>
333 - <?php if( $item->getComments() ) { ?><comments><?php print $item->getComments() ?></comments><?php }?>
 333+ <?php if( $item->getComments() ) { ?><comments><?php print wfExpandUrl( $item->getComments(), PROTO_CURRENT ) ?></comments><?php }?>
334334 </item>
335335 <?php
336336 }
@@ -368,8 +368,8 @@
369369 ?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>">
370370 <id><?php print $this->getFeedId() ?></id>
371371 <title><?php print $this->getTitle() ?></title>
372 - <link rel="self" type="application/atom+xml" href="<?php print $this->getSelfUrl() ?>"/>
373 - <link rel="alternate" type="text/html" href="<?php print $this->getUrl() ?>"/>
 372+ <link rel="self" type="application/atom+xml" href="<?php print wfExpandUrl( $this->getSelfUrl(), PROTO_CURRENT ) ?>"/>
 373+ <link rel="alternate" type="text/html" href="<?php print wfExpandUrl( $this->getUrl(), PROTO_CURRENT ) ?>"/>
374374 <updated><?php print $this->formatTime( wfTimestampNow() ) ?>Z</updated>
375375 <subtitle><?php print $this->getDescription() ?></subtitle>
376376 <generator>MediaWiki <?php print $wgVersion ?></generator>
@@ -410,7 +410,7 @@
411411 <entry>
412412 <id><?php print $item->getUniqueId() ?></id>
413413 <title><?php print $item->getTitle() ?></title>
414 - <link rel="alternate" type="<?php print $wgMimeType ?>" href="<?php print $item->getUrl() ?>"/>
 414+ <link rel="alternate" type="<?php print $wgMimeType ?>" href="<?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ) ?>"/>
415415 <?php if( $item->getDate() ) { ?>
416416 <updated><?php print $this->formatTime( $item->getDate() ) ?>Z</updated>
417417 <?php } ?>
Index: branches/REL1_18/phase3/includes/WikiMap.php
@@ -18,7 +18,7 @@
1919
2020 list( $major, $minor ) = $wgConf->siteFromDB( $wikiID );
2121 if( isset( $major ) ) {
22 - $server = $wgConf->get( 'wgServer', $wikiID, $major,
 22+ $server = $wgConf->get( 'wgCanonicalServer', $wikiID, $major,
2323 array( 'lang' => $minor, 'site' => $major ) );
2424 $path = $wgConf->get( 'wgArticlePath', $wikiID, $major,
2525 array( 'lang' => $minor, 'site' => $major ) );
Index: branches/REL1_18/phase3/includes/Title.php
@@ -1035,14 +1035,16 @@
10361036 * e-mail notifications. Uses $wgCanonicalServer and the
10371037 * GetCanonicalURL hook.
10381038 *
 1039+ * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment
 1040+ *
10391041 * @param $query string An optional query string
10401042 * @param $variant string Language variant of URL (for sr, zh, ...)
10411043 * @return string The URL
10421044 */
10431045 public function getCanonicalURL( $query = '', $variant = false ) {
10441046 global $wgCanonicalServer;
1045 - $url = $wgCanonicalServer . $this->getLocalURL( $query, $variant );
1046 - wfRunHooks( 'GetCanonicalURL', array( &$this, &$url, $query ) );
 1047+ $url = wfExpandUrl( $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL(), PROTO_CANONICAL );
 1048+ wfRunHooks( '', array( &$this, &$url, $query ) );
10471049 return $url;
10481050 }
10491051
Property changes on: branches/REL1_18/phase3/includes/Title.php
___________________________________________________________________
Modified: svn:mergeinfo
10501052 Merged /trunk/phase3/includes/Title.php:r95014,95016-95017,95627,95651-95653,95656,95659,95663,95855,95899,96180,96228,96286,96297
Index: branches/REL1_18/phase3/includes/HttpFunctions.php
@@ -381,7 +381,7 @@
382382 }
383383
384384 if ( is_object( $wgTitle ) && !isset( $this->reqHeaders['Referer'] ) ) {
385 - $this->setReferer( $wgTitle->getFullURL() );
 385+ $this->setReferer( wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) );
386386 }
387387
388388 if ( !$this->noProxy ) {
Index: branches/REL1_18/phase3/includes/specials/SpecialPasswordReset.php
@@ -152,7 +152,7 @@
153153 }
154154 }
155155
156 - global $wgServer, $wgScript, $wgNewPasswordExpiry;
 156+ global $wgNewPasswordExpiry;
157157
158158 // All the users will have the same email address
159159 if ( $firstUser->getEmail() == '' ) {
@@ -190,7 +190,7 @@
191191 $username,
192192 $passwordBlock,
193193 count( $passwords ),
194 - $wgServer . $wgScript,
 194+ Title::newMainPage()->getCanonicalUrl(),
195195 round( $wgNewPasswordExpiry / 86400 )
196196 );
197197

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95014Use getInternalUrl() instead of getFullUrl() in purgeList.php . This was pote...catrope17:20, 19 August 2011
r95016Expand some more URLs: for feeds, referers and the proxy scriptcatrope17:31, 19 August 2011
r95017Use canonical URLs in sitemaps, diff stuff and external edit stuffcatrope17:33, 19 August 2011
r95627Fix bug in r94995: getCanonicalUrl() doesn't append the fragment. This is cor...catrope15:15, 28 August 2011
r95651In WikiMap, pull wgCanonicalServer from $wgConf instead of wgServer for build...catrope08:55, 29 August 2011
r95652Protocol-relative URL fixes for CentralAuth and SiteMatrix:...catrope09:00, 29 August 2011
r95653Protocol-relative URL fixes for Collection:...catrope09:17, 29 August 2011
r95656Rename CodeRevision::getFullUrl() to getCanonicalUrl(), make it behave accord...catrope12:25, 29 August 2011
r95659Switch to using canonical URLs where appropriate in various extensions...catrope12:33, 29 August 2011
r95663Last commit to make WMF-deployed extensions HTTPS-ready (hopefully): use wfEx...catrope14:37, 29 August 2011
r95855Followup r95663: per CR, use the current protocol for expanding the thumbnail...catrope12:09, 31 August 2011
r95899Fix misspelled constant in r95663catrope19:07, 31 August 2011
r96180Use wfExpandUrl+PROTO_CANONICAL inside of getCanonicalURL instead of just pre...dantman13:17, 3 September 2011
r96228(bug 30735) Use protocol-relative URL for geoiplookup. Should not be deployed...catrope14:28, 4 September 2011
r96286Fix r95653: as reported on bug 30680, this broke Collection. Expanding $wgScr...catrope16:06, 5 September 2011
r96297Don't use $wgServer (potentially protocol-relative!) in the password reset e-...catrope19:29, 5 September 2011

Status & tagging log