| Index: branches/REL1_18/extensions/LiquidThreads/classes/View.php |
| — | — | @@ -161,7 +161,13 @@ |
| 162 | 162 | |
| 163 | 163 | return $title->getFullURL( $query ); |
| 164 | 164 | } |
| | 165 | + |
| | 166 | + static function linkInContextCanonicalURL( $thread, $contextType = 'page' ) { |
| | 167 | + list( $title, $query ) = self::linkInContextData( $thread, $contextType ); |
| 165 | 168 | |
| | 169 | + return $title->getCanonicalURL( $query ); |
| | 170 | + } |
| | 171 | + |
| 166 | 172 | static function diffQuery( $thread, $revision ) { |
| 167 | 173 | $changed_thread = $revision->getChangeObject(); |
| 168 | 174 | $curr_rev_id = $changed_thread->rootRevision(); |
| Index: branches/REL1_18/extensions/LiquidThreads/classes/NewMessagesController.php |
| — | — | @@ -285,7 +285,7 @@ |
| 286 | 286 | global $wgPasswordSender; |
| 287 | 287 | $link_title = clone $t->getTitle(); |
| 288 | 288 | $link_title->setFragment( '#' . $t->getAnchorName() ); |
| 289 | | - $permalink = LqtView::linkInContextFullURL( $t ); |
| | 289 | + $permalink = LqtView::linkInContextCanonicalURL( $t ); |
| 290 | 290 | $talkPage = $t->getTitle()->getPrefixedText(); |
| 291 | 291 | $from = new MailAddress( $wgPasswordSender, 'WikiAdmin' ); |
| 292 | 292 | $threadSubject = $t->subject(); |
| Index: branches/REL1_18/extensions/OAI/OAIRepo_body.php |
| — | — | @@ -544,7 +544,7 @@ |
| 545 | 545 | |
| 546 | 546 | function baseUrl() { |
| 547 | 547 | $title =& SpecialPage::getTitleFor( 'OAIRepository' ); |
| 548 | | - return $title->getFullUrl(); |
| | 548 | + return $title->getCanonicalUrl(); |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | function earliestDatestamp() { |
| — | — | @@ -828,7 +828,7 @@ |
| 829 | 829 | oaiTag( 'dc:language', array(), $wgContLanguageCode ) . "\n" . |
| 830 | 830 | oaiTag( 'dc:type', array(), 'Text' ) . "\n" . |
| 831 | 831 | oaiTag( 'dc:format', array(), $wgMimeType ) . "\n" . |
| 832 | | - oaiTag( 'dc:identifier', array(), $title->getFullUrl() ) . "\n" . |
| | 832 | + oaiTag( 'dc:identifier', array(), $title->getCanonicalUrl() ) . "\n" . |
| 833 | 833 | oaiTag( 'dc:contributor', array(), $this->_row->rev_user_text ) . "\n" . |
| 834 | 834 | oaiTag( 'dc:date', array(), oaiDatestamp( $this->getDatestamp() ) ) . "\n" . |
| 835 | 835 | "</oai_dc:dc>\n"; |
| Index: branches/REL1_18/extensions/SpamBlacklist/SpamBlacklist_body.php |
| — | — | @@ -35,7 +35,7 @@ |
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | | - $thisHttp = $title->getFullUrl( 'action=raw' ); |
| | 39 | + $thisHttp = wfExpandUrl( $title->getFullUrl( 'action=raw' ), PROTO_HTTP ); |
| 40 | 40 | $thisHttpRegex = '/^' . preg_quote( $thisHttp, '/' ) . '(?:&.*)?$/'; |
| 41 | 41 | |
| 42 | 42 | foreach( $this->files as $fileName ) { |
| Index: branches/REL1_18/extensions/SiteMatrix/SiteMatrixApi.php |
| — | — | @@ -57,7 +57,7 @@ |
| 58 | 58 | |
| 59 | 59 | $url = $matrix->getUrl( $lang, $site ); |
| 60 | 60 | $site_out = array( |
| 61 | | - 'url' => wfExpandUrl( $url ), |
| | 61 | + 'url' => $url, |
| 62 | 62 | 'dbname' => $matrix->getDBName( $lang, $site ), |
| 63 | 63 | 'code' => $site, |
| 64 | 64 | ); |
| — | — | @@ -91,7 +91,7 @@ |
| 92 | 92 | $url = $matrix->getUrl( $lang, $site ); |
| 93 | 93 | |
| 94 | 94 | $wiki = array(); |
| 95 | | - $wiki['url'] = wfExpandUrl( $url ); |
| | 95 | + $wiki['url'] = $url; |
| 96 | 96 | $wiki['dbname'] = $matrix->getDBName( $lang, $site ); |
| 97 | 97 | $wiki['code'] = str_replace( '_', '-', $lang ) . ( $site != 'wiki' ? $site : '' ); |
| 98 | 98 | |
| Index: branches/REL1_18/extensions/SiteMatrix/SiteMatrix_body.php |
| — | — | @@ -135,7 +135,7 @@ |
| 136 | 136 | global $wgConf; |
| 137 | 137 | $dbname = $this->getDBName( $minor, $major ); |
| 138 | 138 | $minor = str_replace( '_', '-', $minor ); |
| 139 | | - return $wgConf->get( 'wgServer', $dbname, $major, |
| | 139 | + return $wgConf->get( 'wgCanonicalServer', $dbname, $major, |
| 140 | 140 | array( 'lang' => $minor, 'site' => $major ) ); |
| 141 | 141 | } |
| 142 | 142 | |
| Index: branches/REL1_18/extensions/CentralAuth/ApiQueryGlobalUserInfo.php |
| — | — | @@ -82,7 +82,7 @@ |
| 83 | 83 | |
| 84 | 84 | $a = array( |
| 85 | 85 | 'wiki' => $dbname, |
| 86 | | - 'url' => wfExpandUrl( $this->getUrl( $dbname ) ), |
| | 86 | + 'url' => $this->getUrl( $dbname ), |
| 87 | 87 | 'timestamp' => wfTimestamp( TS_ISO_8601, $account['attachedTimestamp'] ), |
| 88 | 88 | 'method' => $account['attachedMethod'], |
| 89 | 89 | 'editcount' => $account['editCount'] |
| — | — | @@ -121,7 +121,7 @@ |
| 122 | 122 | |
| 123 | 123 | list( $major, $minor ) = $wgConf->siteFromDB( $dbname ); |
| 124 | 124 | $minor = str_replace( '_', '-', $minor ); |
| 125 | | - return $wgConf->get( 'wgServer', $dbname, $major, |
| | 125 | + return $wgConf->get( 'wgCanonicalServer', $dbname, $major, |
| 126 | 126 | array( 'lang' => $minor, 'site' => $major ) ); |
| 127 | 127 | } |
| 128 | 128 | |
| Index: branches/REL1_18/extensions/CentralAuth/CentralAuthUser.php |
| — | — | @@ -1188,8 +1188,7 @@ |
| 1189 | 1189 | protected static function getIRCLine( $userpage, $wikiID ) { |
| 1190 | 1190 | $title = RecentChange::cleanupForIRC( $userpage->getPrefixedText() ); |
| 1191 | 1191 | $wikiID = RecentChange::cleanupForIRC( $wikiID ); |
| 1192 | | - // FIXME: *HACK* should be getFullURL(), hacked for SSL madness |
| 1193 | | - $url = $userpage->getInternalURL(); |
| | 1192 | + $url = $userpage->getCanonicalURL(); |
| 1194 | 1193 | $user = RecentChange::cleanupForIRC( $userpage->getText() ); |
| 1195 | 1194 | # see http://www.irssi.org/documentation/formats for some colour codes. prefix is \003, |
| 1196 | 1195 | # no colour (\003) switches back to the term default |
| Index: branches/REL1_18/extensions/DoubleWiki/DoubleWiki_body.php |
| — | — | @@ -74,7 +74,7 @@ |
| 75 | 75 | if( $cachedText ) { |
| 76 | 76 | $text = $cachedText; |
| 77 | 77 | } else { |
| 78 | | - $url = $nt->getFullURL(); |
| | 78 | + $url = $nt->getCanonicalURL(); |
| 79 | 79 | $myURL = $out->getTitle()->getLocalURL(); |
| 80 | 80 | $languageName = $wgContLang->getLanguageName( $iw ); |
| 81 | 81 | $myLanguage = $wgLang->getLanguageName( $wgContLang->getCode() ); |
| Index: branches/REL1_18/extensions/SecurePoll/includes/entities/Election.php |
| — | — | @@ -377,7 +377,7 @@ |
| 378 | 378 | Xml::element( 'auth', array(), 'local' ) . "\n" . |
| 379 | 379 | Xml::element( 'property', |
| 380 | 380 | array( 'name' => 'jump-url' ), |
| 381 | | - $this->context->getSpecialTitle()->getFullURL() |
| | 381 | + $this->context->getSpecialTitle()->getCanonicalUrl() |
| 382 | 382 | ) . "\n" . |
| 383 | 383 | Xml::element( 'property', |
| 384 | 384 | array( 'name' => 'jump-id' ), |
| Index: branches/REL1_18/extensions/SecurePoll/includes/user/Auth.php |
| — | — | @@ -205,7 +205,7 @@ |
| 206 | 206 | 'name' => $user->getName(), |
| 207 | 207 | 'type' => 'local', |
| 208 | 208 | 'domain' => preg_replace( '!.*/(.*)$!', '$1', $wgServer ), |
| 209 | | - 'url' => $user->getUserPage()->getFullURL(), |
| | 209 | + 'url' => $user->getUserPage()->getCanonicalURL(), |
| 210 | 210 | 'properties' => array( |
| 211 | 211 | 'wiki' => wfWikiID(), |
| 212 | 212 | 'blocked' => $user->isBlocked(), |
| Index: branches/REL1_18/extensions/ContributionTracking/ContributionTracking_body.php |
| — | — | @@ -93,7 +93,7 @@ |
| 94 | 94 | $returnText = $wgRequest->getText( 'returnto', "Donate-thanks/$language" ); |
| 95 | 95 | $returnTitle = Title::newFromText( $returnText ); |
| 96 | 96 | if( $returnTitle ) { |
| 97 | | - $returnto = $returnTitle->getFullUrl(); |
| | 97 | + $returnto = wfExpandUrl( $returnTitle->getFullUrl(), PROTO_CURRENT ); |
| 98 | 98 | } else { |
| 99 | 99 | $returnto = $wgContributionTrackingReturnToURLDefault . "/$language"; |
| 100 | 100 | } |
| Index: branches/REL1_18/extensions/Collection/Collection.php |
| — | — | @@ -216,12 +216,12 @@ |
| 217 | 217 | $r = new AjaxResponse(); |
| 218 | 218 | if ( $redirect ) { |
| 219 | 219 | $title = Title::newFromText( $redirect ); |
| 220 | | - $redirecturl = $title->getFullURL(); |
| | 220 | + $redirecturl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ); |
| 221 | 221 | $r->setResponseCode( 302 ); |
| 222 | 222 | header( 'Location: ' . $redirecturl ); |
| 223 | 223 | } else { |
| 224 | 224 | $title = SpecialPage::getTitleFor( 'Book' ); |
| 225 | | - $redirecturl = $title->getFullURL(); |
| | 225 | + $redirecturl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ); |
| 226 | 226 | $r->setContentType( 'application/json' ); |
| 227 | 227 | $r->addText( $json->encode( array( 'redirect_url' => $redirecturl ) ) ); |
| 228 | 228 | } |
| Index: branches/REL1_18/extensions/Collection/Collection.body.php |
| — | — | @@ -577,7 +577,7 @@ |
| 578 | 578 | 'revision' => strval( $oldid ), |
| 579 | 579 | 'latest' => strval( $latest ), |
| 580 | 580 | 'timestamp' => wfTimestamp( TS_UNIX, $revision->mTimestamp ), |
| 581 | | - 'url' => $title->getFullURL(), |
| | 581 | + 'url' => $title->getCanonicalURL(), |
| 582 | 582 | 'currentVersion' => $currentVersion, |
| 583 | 583 | ); |
| 584 | 584 | |
| — | — | @@ -762,7 +762,7 @@ |
| 763 | 763 | 'latest' => $latest, |
| 764 | 764 | 'revision' => $oldid, |
| 765 | 765 | 'timestamp' => wfTimestamp( TS_UNIX, $revision->mTimestamp ), |
| 766 | | - 'url' => $articleTitle->getFullURL(), |
| | 766 | + 'url' => $articleTitle->getCanonicalURL(), |
| 767 | 767 | 'currentVersion' => $currentVersion, |
| 768 | 768 | ); |
| 769 | 769 | if ( $displayTitle ) { |
| — | — | @@ -952,7 +952,7 @@ |
| 953 | 953 | |
| 954 | 954 | $response = self::mwServeCommand( 'render', array( |
| 955 | 955 | 'metabook' => $this->buildJSONCollection( $collection ), |
| 956 | | - 'base_url' => wfExpandUrl( $wgScriptPath ), |
| | 956 | + 'base_url' => wfExpandUrl( $wgScriptPath, PROTO_CURRENT ), |
| 957 | 957 | 'script_extension' => $wgScriptExtension, |
| 958 | 958 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
| 959 | 959 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
| — | — | @@ -985,7 +985,7 @@ |
| 986 | 986 | |
| 987 | 987 | $response = self::mwServeCommand( 'render', array( |
| 988 | 988 | 'collection_id' => $collectionID, |
| 989 | | - 'base_url' => wfExpandUrl( $wgScriptPath ), |
| | 989 | + 'base_url' => wfExpandUrl( $wgScriptPath, PROTO_CURRENT ), |
| 990 | 990 | 'script_extension' => $wgScriptExtension, |
| 991 | 991 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
| 992 | 992 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
| — | — | @@ -1060,7 +1060,7 @@ |
| 1061 | 1061 | $wgOut->setPageTitle( wfMsg( 'coll-rendering_finished_title' ) ); |
| 1062 | 1062 | |
| 1063 | 1063 | $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 ) ); |
| 1065 | 1065 | $template->set( 'is_cached', $wgRequest->getVal( 'is_cached' ) ); |
| 1066 | 1066 | $template->set( 'query', $query ); |
| 1067 | 1067 | $template->set( 'return_to', $return_to ); |
| — | — | @@ -1150,7 +1150,7 @@ |
| 1151 | 1151 | |
| 1152 | 1152 | $response = self::mwServeCommand( 'zip_post', array( |
| 1153 | 1153 | 'metabook' => $this->buildJSONCollection( $collection ), |
| 1154 | | - 'base_url' => wfExpandUrl( $wgScriptPath ), |
| | 1154 | + 'base_url' => wfExpandUrl( $wgScriptPath, PROTO_CURRENT ), |
| 1155 | 1155 | 'script_extension' => $wgScriptExtension, |
| 1156 | 1156 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
| 1157 | 1157 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
| — | — | @@ -1271,7 +1271,7 @@ |
| 1272 | 1272 | curl_setopt( $c, CURLOPT_HTTPHEADER, array( 'Expect:' ) ); |
| 1273 | 1273 | curl_setopt( $c, CURLOPT_HEADER, false ); |
| 1274 | 1274 | if ( is_object( $wgTitle ) ) { |
| 1275 | | - curl_setopt( $c, CURLOPT_REFERER, $wgTitle->getFullURL() ); |
| | 1275 | + curl_setopt( $c, CURLOPT_REFERER, wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) ); |
| 1276 | 1276 | } |
| 1277 | 1277 | if ( $timeout ) { |
| 1278 | 1278 | curl_setopt( $c, CURLOPT_TIMEOUT, $wgHTTPTimeout ); |
| Index: branches/REL1_18/extensions/GlobalUsage/ApiQueryGlobalUsage.php |
| — | — | @@ -62,8 +62,7 @@ |
| 63 | 63 | 'wiki' => WikiMap::getWikiName( $wiki ) |
| 64 | 64 | ); |
| 65 | 65 | if ( isset( $prop['url'] ) ) { |
| 66 | | - $result['url'] = wfExpandUrl( |
| 67 | | - WikiMap::getForeignUrl( $item['wiki'], $title ) ); |
| | 66 | + $result['url'] = WikiMap::getForeignUrl( $item['wiki'], $title ); |
| 68 | 67 | } |
| 69 | 68 | if ( isset( $prop['pageid'] ) ) { |
| 70 | 69 | $result['pageid'] = $item['id']; |
| Index: branches/REL1_18/extensions/EmailCapture/api/ApiEmailCapture.php |
| — | — | @@ -33,8 +33,8 @@ |
| 34 | 34 | // Send auto-response |
| 35 | 35 | global $wgEmailCaptureSendAutoResponse, $wgEmailCaptureAutoResponse; |
| 36 | 36 | $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 ) ); |
| 39 | 39 | if ( $wgEmailCaptureSendAutoResponse ) { |
| 40 | 40 | UserMailer::send( |
| 41 | 41 | new MailAddress( $params['email'] ), |
| Index: branches/REL1_18/extensions/CodeReview/backend/CodeRevision.php |
| — | — | @@ -439,13 +439,13 @@ |
| 440 | 440 | ); |
| 441 | 441 | |
| 442 | 442 | // Get repo and build comment title (for url) |
| 443 | | - $url = $this->getFullUrl(); |
| | 443 | + $url = $this->getCanonicalUrl(); |
| 444 | 444 | |
| 445 | 445 | foreach ( $res as $row ) { |
| 446 | 446 | $revision = CodeRevision::newFromRow( $this->repo, $row ); |
| 447 | 447 | $users = $revision->getCommentingUsers(); |
| 448 | 448 | |
| 449 | | - $rowUrl = $revision->getFullUrl(); |
| | 449 | + $rowUrl = $revision->getCanonicalUrl(); |
| 450 | 450 | |
| 451 | 451 | $revisionAuthor = $revision->getWikiUser(); |
| 452 | 452 | |
| — | — | @@ -623,7 +623,7 @@ |
| 624 | 624 | $commentId = $dbw->insertId(); |
| 625 | 625 | $dbw->commit(); |
| 626 | 626 | |
| 627 | | - $url = $this->getFullUrl( $commentId ); |
| | 627 | + $url = $this->getCanonicalUrl( $commentId ); |
| 628 | 628 | |
| 629 | 629 | $this->sendCommentToUDP( $commentId, $text, $url ); |
| 630 | 630 | |
| — | — | @@ -1238,10 +1238,12 @@ |
| 1239 | 1239 | } |
| 1240 | 1240 | |
| 1241 | 1241 | /** |
| | 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(). |
| 1242 | 1244 | * @param string $commentId |
| 1243 | 1245 | * @return \type |
| 1244 | 1246 | */ |
| 1245 | | - public function getFullUrl( $commentId = 0 ) { |
| | 1247 | + public function getCanonicalUrl( $commentId = 0 ) { |
| 1246 | 1248 | $title = SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/' . $this->id ); |
| 1247 | 1249 | |
| 1248 | 1250 | # Append comment id if not null, empty string or zero |
| — | — | @@ -1249,7 +1251,7 @@ |
| 1250 | 1252 | $title->setFragment( "#c{$commentId}" ); |
| 1251 | 1253 | } |
| 1252 | 1254 | |
| 1253 | | - return $title->getFullUrl(); |
| | 1255 | + return $title->getCanonicalUrl(); |
| 1254 | 1256 | } |
| 1255 | 1257 | |
| 1256 | 1258 | /** |
| — | — | @@ -1263,7 +1265,7 @@ |
| 1264 | 1266 | |
| 1265 | 1267 | if( $wgCodeReviewUDPAddress ) { |
| 1266 | 1268 | if( is_null( $url ) ) { |
| 1267 | | - $url = $this->getFullUrl( $commentId ); |
| | 1269 | + $url = $this->getCanonicalUrl( $commentId ); |
| 1268 | 1270 | } |
| 1269 | 1271 | |
| 1270 | 1272 | $line = wfMsg( 'code-rev-message' ) . " \00314(" . $this->repo->getName() . |
| — | — | @@ -1282,7 +1284,7 @@ |
| 1283 | 1285 | global $wgCodeReviewUDPAddress, $wgCodeReviewUDPPort, $wgCodeReviewUDPPrefix, $wgUser; |
| 1284 | 1286 | |
| 1285 | 1287 | if( $wgCodeReviewUDPAddress ) { |
| 1286 | | - $url = $this->getFullUrl(); |
| | 1288 | + $url = $this->getCanonicalUrl(); |
| 1287 | 1289 | |
| 1288 | 1290 | $line = wfMsg( 'code-rev-status' ) . " \00314(" . $this->repo->getName() . |
| 1289 | 1291 | ")\00303 " . RecentChange::cleanupForIRC( $wgUser->getName() ) . "\003 " . |
| Property changes on: branches/REL1_18/extensions/CodeReview/backend/CodeRevision.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 1290 | 1292 | 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 @@ |
| 42 | 42 | // $this->assertEquals( '', $formatter->link( '' ) ); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | | - public function testCommentFullUrl() { |
| | 45 | + public function testCommentCanonicalUrl() { |
| 46 | 46 | # Fixture: |
| 47 | 47 | $repo = $this->createRepo(); |
| 48 | 48 | $cr = CodeRevision::newFromSvn( $repo, array( |
| — | — | @@ -54,14 +54,14 @@ |
| 55 | 55 | ); |
| 56 | 56 | |
| 57 | 57 | # Find out our revision root URL |
| 58 | | - $baseUrl = SpecialPage::getTitleFor( 'Code', $repo->getName().'/305' )->getFullUrl(); |
| | 58 | + $baseUrl = SpecialPage::getTitleFor( 'Code', $repo->getName().'/305' )->getCanonicalUrl(); |
| 59 | 59 | |
| 60 | 60 | # 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" ) ); |
| 67 | 67 | } |
| 68 | 68 | } |
| Property changes on: branches/REL1_18/extensions/CodeReview/tests/CodeReviewTest.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 69 | 69 | 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 @@ |
| 118 | 118 | $dbw->commit(); |
| 119 | 119 | |
| 120 | 120 | if ( $statusChanged || $commentAdded ) { |
| 121 | | - $url = $this->mRev->getFullUrl( $commentId ); |
| | 121 | + $url = $this->mRev->getCanonicalUrl( $commentId ); |
| 122 | 122 | if ( $statusChanged && $commentAdded ) { |
| 123 | 123 | $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj4', 'codereview-email-body4', |
| 124 | 124 | $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(), |
| Index: branches/REL1_18/extensions/CentralNotice/CentralNotice.php |
| — | — | @@ -187,7 +187,7 @@ |
| 188 | 188 | |
| 189 | 189 | function efCentralNoticeGeoLoader( $skin, &$text ) { |
| 190 | 190 | // 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>'; |
| 192 | 192 | return true; |
| 193 | 193 | } |
| 194 | 194 | |
| Index: branches/REL1_18/extensions/OpenSearchXml/ApiOpenSearchXml.php |
| — | — | @@ -122,11 +122,11 @@ |
| 123 | 123 | $item = array(); |
| 124 | 124 | $item['Text']['*'] = $title->getPrefixedText(); |
| 125 | 125 | $item['Description']['*'] = $extract; |
| 126 | | - $item['Url']['*'] = $title->getFullUrl(); |
| | 126 | + $item['Url']['*'] = wfExpandUrl( $title->getFullUrl(), PROTO_CURRENT ); |
| 127 | 127 | if( $image ) { |
| 128 | 128 | $thumb = $image->transform( array( 'width' => 50, 'height' => 50 ), 0 ); |
| 129 | 129 | $item['Image'] = array( |
| 130 | | - 'source' => wfExpandUrl( $thumb->getUrl() ), |
| | 130 | + 'source' => wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ), |
| 131 | 131 | //alt |
| 132 | 132 | 'width' => $thumb->getWidth(), |
| 133 | 133 | 'height' => $thumb->getHeight() ); |
| Index: branches/REL1_18/extensions/AbuseFilter/AbuseFilter.class.php |
| — | — | @@ -1705,12 +1705,12 @@ |
| 1706 | 1706 | static function modifyActionText( $page, $type, $title, $sk, $args ) { |
| 1707 | 1707 | list( $history_id, $filter_id ) = $args; |
| 1708 | 1708 | |
| 1709 | | - $filter_link = $sk ? $sk->link( $title ) : $title->getFullURL(); |
| | 1709 | + $filter_link = $sk ? $sk->link( $title ) : $title->getCanonicalURL(); |
| 1710 | 1710 | |
| 1711 | 1711 | $details_title = SpecialPage::getTitleFor( 'AbuseFilter', "history/$filter_id/diff/prev/$history_id" ); |
| 1712 | 1712 | $details_text = wfMsgExt( 'abusefilter-log-detailslink', 'parseinline' ); |
| 1713 | 1713 | $details_link = |
| 1714 | | - $sk ? $sk->link( $details_title, $details_text ) : $details_title->getFullURL(); |
| | 1714 | + $sk ? $sk->link( $details_title, $details_text ) : $details_title->getCanonicalURL(); |
| 1715 | 1715 | |
| 1716 | 1716 | return wfMsgExt( 'abusefilter-log-entry-modify', |
| 1717 | 1717 | array( 'parseinline', 'replaceafter' ), array( $filter_link, $details_link ) ); |
| Index: branches/REL1_18/extensions/ActiveAbstract/AbstractFilter.php |
| — | — | @@ -55,7 +55,7 @@ |
| 56 | 56 | |
| 57 | 57 | $xml = "<doc>\n"; |
| 58 | 58 | $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"; |
| 60 | 60 | |
| 61 | 61 | // add abstract and links when we have revision data... |
| 62 | 62 | $this->revision = null; |
| — | — | @@ -216,7 +216,7 @@ |
| 217 | 217 | $stripped = $this->_stripMarkup( $inside ); // strip internal markup and <h[1-6]> |
| 218 | 218 | $header = UtfNormal::cleanUp( $stripped ); |
| 219 | 219 | $anchor = EditPage::sectionAnchor( $header ); |
| 220 | | - $url = $this->title->getFullUrl() . $anchor; |
| | 220 | + $url = $this->title->getCanonicalUrl() . $anchor; |
| 221 | 221 | $headers[$header] = $url; |
| 222 | 222 | } |
| 223 | 223 | return $headers; |
| — | — | @@ -239,7 +239,7 @@ |
| 240 | 240 | $links = array(); |
| 241 | 241 | while ( $row = $dbr->fetchObject( $result ) ) { |
| 242 | 242 | $category = Title::makeTitle( NS_CATEGORY, $row->cl_to ); |
| 243 | | - $links[$category->getText()] = $category->getFullUrl(); |
| | 243 | + $links[$category->getText()] = $category->getCanonicalUrl(); |
| 244 | 244 | } |
| 245 | 245 | $dbr->freeResult( $result ); |
| 246 | 246 | |
| Index: branches/REL1_18/extensions/ActiveAbstract/GoogleCoopFilter.php |
| — | — | @@ -72,7 +72,7 @@ |
| 73 | 73 | $xml .= ' ' . Xml::element( 'Output', array( 'name' => 'title' ), |
| 74 | 74 | $wgSitename . ':' . $this->title->getPrefixedText() ) . "\n"; |
| 75 | 75 | $xml .= ' ' . Xml::element( 'Output', array( 'name' => 'more_url' ), |
| 76 | | - $this->title->getFullUrl() ) . "\n"; |
| | 76 | + $this->title->getCanonicalUrl() ) . "\n"; |
| 77 | 77 | |
| 78 | 78 | // add abstract and links when we have revision data... |
| 79 | 79 | $this->revision = null; |
| Index: branches/REL1_18/phase3/maintenance/generateSitemap.php |
| — | — | @@ -298,7 +298,7 @@ |
| 299 | 299 | } |
| 300 | 300 | $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
| 301 | 301 | $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 ) ); |
| 303 | 303 | $length += strlen( $entry ); |
| 304 | 304 | $this->write( $this->file, $entry ); |
| 305 | 305 | // generate pages for language variants |
| — | — | @@ -306,7 +306,7 @@ |
| 307 | 307 | $variants = $wgContLang->getVariants(); |
| 308 | 308 | foreach ( $variants as $vCode ) { |
| 309 | 309 | 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 ) ); |
| 311 | 311 | $length += strlen( $entry ); |
| 312 | 312 | $this->write( $this->file, $entry ); |
| 313 | 313 | } |
| — | — | @@ -456,7 +456,7 @@ |
| 457 | 457 | |
| 458 | 458 | $this->limit = array( |
| 459 | 459 | 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 ) ) ), |
| 461 | 461 | strlen( $this->closeFile() ) |
| 462 | 462 | ); |
| 463 | 463 | } |
| Index: branches/REL1_18/phase3/maintenance/purgeList.php |
| — | — | @@ -52,7 +52,7 @@ |
| 53 | 53 | } elseif ( $page !== '' ) { |
| 54 | 54 | $title = Title::newFromText( $page ); |
| 55 | 55 | if ( $title ) { |
| 56 | | - $url = $title->getFullUrl(); |
| | 56 | + $url = $title->getInternalUrl(); |
| 57 | 57 | $this->output( "$url\n" ); |
| 58 | 58 | $urls[] = $url; |
| 59 | 59 | if ( $this->getOption( 'purge' ) ) { |
| — | — | @@ -105,7 +105,7 @@ |
| 106 | 106 | $urls = array(); |
| 107 | 107 | foreach( $result as $row ) { |
| 108 | 108 | $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
| 109 | | - $url = $title->getFullUrl(); |
| | 109 | + $url = $title->getInternalUrl(); |
| 110 | 110 | $urls[] = $url; |
| 111 | 111 | } |
| 112 | 112 | |
| Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18 |
| — | — | @@ -611,6 +611,8 @@ |
| 612 | 612 | * Removed legacy wgAjaxWatch javascript global object, no longer in use. |
| 613 | 613 | * (bug 28556) Upload support for MacBinary files has been removed (Used by |
| 614 | 614 | 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'. |
| 615 | 617 | |
| 616 | 618 | == Compatibility == |
| 617 | 619 | |
| Property changes on: branches/REL1_18/phase3/RELEASE-NOTES-1.18 |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 618 | 620 | 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 @@ |
| 165 | 165 | if ( !$skip ) { |
| 166 | 166 | $title = SpecialPage::getTitleFor( 'Blockme' ); |
| 167 | 167 | $iphash = md5( $ip . $wgProxyKey ); |
| 168 | | - $url = $title->getFullURL( 'ip='.$iphash ); |
| | 168 | + $url = wfExpandUrl( $title->getFullURL( 'ip='.$iphash ), PROTO_HTTP ); |
| 169 | 169 | |
| 170 | 170 | foreach ( $wgProxyPorts as $port ) { |
| 171 | 171 | $params = implode( ' ', array( |
| Index: branches/REL1_18/phase3/includes/diff/DifferenceEngine.php |
| — | — | @@ -186,14 +186,14 @@ |
| 187 | 187 | # we'll use the application/x-external-editor interface to call |
| 188 | 188 | # an external diff tool like kompare, kdiff3, etc. |
| 189 | 189 | if ( $wgUseExternalEditor && $wgUser->getOption( 'externaldiff' ) ) { |
| 190 | | - global $wgServer, $wgScript, $wgLang; |
| | 190 | + global $wgCanonicalServer, $wgScript, $wgLang; |
| 191 | 191 | $wgOut->disable(); |
| 192 | 192 | header ( "Content-type: application/x-external-editor; charset=UTF-8" ); |
| 193 | | - $url1 = $this->mTitle->getFullURL( array( |
| | 193 | + $url1 = $this->mTitle->getCanonical( array( |
| 194 | 194 | 'action' => 'raw', |
| 195 | 195 | 'oldid' => $this->mOldid |
| 196 | 196 | ) ); |
| 197 | | - $url2 = $this->mTitle->getFullURL( array( |
| | 197 | + $url2 = $this->mTitle->getCanonical( array( |
| 198 | 198 | 'action' => 'raw', |
| 199 | 199 | 'oldid' => $this->mNewid |
| 200 | 200 | ) ); |
| — | — | @@ -202,7 +202,7 @@ |
| 203 | 203 | [Process] |
| 204 | 204 | Type=Diff text |
| 205 | 205 | Engine=MediaWiki |
| 206 | | - Script={$wgServer}{$wgScript} |
| | 206 | + Script={$wgCanonicalServer}{$wgScript} |
| 207 | 207 | Special namespace={$special} |
| 208 | 208 | |
| 209 | 209 | [File] |
| Index: branches/REL1_18/phase3/includes/ExternalEdit.php |
| — | — | @@ -45,7 +45,7 @@ |
| 46 | 46 | * Output the information for the external editor |
| 47 | 47 | */ |
| 48 | 48 | public function edit() { |
| 49 | | - global $wgOut, $wgScript, $wgScriptPath, $wgServer, $wgLang; |
| | 49 | + global $wgOut, $wgScript, $wgScriptPath, $wgCanonicalServer, $wgLang; |
| 50 | 50 | $wgOut->disable(); |
| 51 | 51 | header( 'Content-type: application/x-external-editor; charset=utf-8' ); |
| 52 | 52 | header( 'Cache-control: no-cache' ); |
| — | — | @@ -56,11 +56,11 @@ |
| 57 | 57 | if( $this->mode == "file" ) { |
| 58 | 58 | $type = "Edit file"; |
| 59 | 59 | $image = wfLocalFile( $this->title ); |
| 60 | | - $url = $image->getFullURL(); |
| | 60 | + $url = $image->getCanonicalURL(); |
| 61 | 61 | $extension = $image->getExtension(); |
| 62 | 62 | } else { |
| 63 | 63 | $type = "Edit text"; |
| 64 | | - $url = $this->title->getFullURL( |
| | 64 | + $url = $this->title->getCanonicalURL( |
| 65 | 65 | array( 'action' => 'edit', 'internaledit' => 'true' ) ); |
| 66 | 66 | # *.wiki file extension is used by some editors for syntax |
| 67 | 67 | # highlighting, so we follow that convention |
| — | — | @@ -76,8 +76,8 @@ |
| 77 | 77 | [Process] |
| 78 | 78 | Type=$type |
| 79 | 79 | Engine=MediaWiki |
| 80 | | -Script={$wgServer}{$wgScript} |
| 81 | | -Server={$wgServer} |
| | 80 | +Script={$wgCanonicalServer}{$wgScript} |
| | 81 | +Server={$wgCanonicalServer} |
| 82 | 82 | Path={$wgScriptPath} |
| 83 | 83 | Special namespace=$special |
| 84 | 84 | |
| Index: branches/REL1_18/phase3/includes/Feed.php |
| — | — | @@ -308,7 +308,7 @@ |
| 309 | 309 | ?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> |
| 310 | 310 | <channel> |
| 311 | 311 | <title><?php print $this->getTitle() ?></title> |
| 312 | | - <link><?php print $this->getUrl() ?></link> |
| | 312 | + <link><?php print wfExpandUrl( $this->getUrl(), PROTO_CURRENT ) ?></link> |
| 313 | 313 | <description><?php print $this->getDescription() ?></description> |
| 314 | 314 | <language><?php print $this->getLanguage() ?></language> |
| 315 | 315 | <generator>MediaWiki <?php print $wgVersion ?></generator> |
| — | — | @@ -324,12 +324,12 @@ |
| 325 | 325 | ?> |
| 326 | 326 | <item> |
| 327 | 327 | <title><?php print $item->getTitle() ?></title> |
| 328 | | - <link><?php print $item->getUrl() ?></link> |
| | 328 | + <link><?php print wfExpandUrl( $item->getUrl(), PROTO_CURRENT ) ?></link> |
| 329 | 329 | <guid<?php if( !$item->RSSIsPermalink ) print ' isPermaLink="false"' ?>><?php print $item->getUniqueId() ?></guid> |
| 330 | 330 | <description><?php print $item->getDescription() ?></description> |
| 331 | 331 | <?php if( $item->getDate() ) { ?><pubDate><?php print $this->formatTime( $item->getDate() ) ?></pubDate><?php } ?> |
| 332 | 332 | <?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 }?> |
| 334 | 334 | </item> |
| 335 | 335 | <?php |
| 336 | 336 | } |
| — | — | @@ -368,8 +368,8 @@ |
| 369 | 369 | ?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="<?php print $this->getLanguage() ?>"> |
| 370 | 370 | <id><?php print $this->getFeedId() ?></id> |
| 371 | 371 | <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 ) ?>"/> |
| 374 | 374 | <updated><?php print $this->formatTime( wfTimestampNow() ) ?>Z</updated> |
| 375 | 375 | <subtitle><?php print $this->getDescription() ?></subtitle> |
| 376 | 376 | <generator>MediaWiki <?php print $wgVersion ?></generator> |
| — | — | @@ -410,7 +410,7 @@ |
| 411 | 411 | <entry> |
| 412 | 412 | <id><?php print $item->getUniqueId() ?></id> |
| 413 | 413 | <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 ) ?>"/> |
| 415 | 415 | <?php if( $item->getDate() ) { ?> |
| 416 | 416 | <updated><?php print $this->formatTime( $item->getDate() ) ?>Z</updated> |
| 417 | 417 | <?php } ?> |
| Index: branches/REL1_18/phase3/includes/WikiMap.php |
| — | — | @@ -18,7 +18,7 @@ |
| 19 | 19 | |
| 20 | 20 | list( $major, $minor ) = $wgConf->siteFromDB( $wikiID ); |
| 21 | 21 | if( isset( $major ) ) { |
| 22 | | - $server = $wgConf->get( 'wgServer', $wikiID, $major, |
| | 22 | + $server = $wgConf->get( 'wgCanonicalServer', $wikiID, $major, |
| 23 | 23 | array( 'lang' => $minor, 'site' => $major ) ); |
| 24 | 24 | $path = $wgConf->get( 'wgArticlePath', $wikiID, $major, |
| 25 | 25 | array( 'lang' => $minor, 'site' => $major ) ); |
| Index: branches/REL1_18/phase3/includes/Title.php |
| — | — | @@ -1035,14 +1035,16 @@ |
| 1036 | 1036 | * e-mail notifications. Uses $wgCanonicalServer and the |
| 1037 | 1037 | * GetCanonicalURL hook. |
| 1038 | 1038 | * |
| | 1039 | + * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment |
| | 1040 | + * |
| 1039 | 1041 | * @param $query string An optional query string |
| 1040 | 1042 | * @param $variant string Language variant of URL (for sr, zh, ...) |
| 1041 | 1043 | * @return string The URL |
| 1042 | 1044 | */ |
| 1043 | 1045 | public function getCanonicalURL( $query = '', $variant = false ) { |
| 1044 | 1046 | 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 ) ); |
| 1047 | 1049 | return $url; |
| 1048 | 1050 | } |
| 1049 | 1051 | |
| Property changes on: branches/REL1_18/phase3/includes/Title.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 1050 | 1052 | 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 @@ |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | if ( is_object( $wgTitle ) && !isset( $this->reqHeaders['Referer'] ) ) { |
| 385 | | - $this->setReferer( $wgTitle->getFullURL() ); |
| | 385 | + $this->setReferer( wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) ); |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | if ( !$this->noProxy ) { |
| Index: branches/REL1_18/phase3/includes/specials/SpecialPasswordReset.php |
| — | — | @@ -152,7 +152,7 @@ |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | | - global $wgServer, $wgScript, $wgNewPasswordExpiry; |
| | 156 | + global $wgNewPasswordExpiry; |
| 157 | 157 | |
| 158 | 158 | // All the users will have the same email address |
| 159 | 159 | if ( $firstUser->getEmail() == '' ) { |
| — | — | @@ -190,7 +190,7 @@ |
| 191 | 191 | $username, |
| 192 | 192 | $passwordBlock, |
| 193 | 193 | count( $passwords ), |
| 194 | | - $wgServer . $wgScript, |
| | 194 | + Title::newMainPage()->getCanonicalUrl(), |
| 195 | 195 | round( $wgNewPasswordExpiry / 86400 ) |
| 196 | 196 | ); |
| 197 | 197 | |