Index: branches/wmf/1.17wmf1/extensions/LiquidThreads/classes/View.php |
— | — | @@ -156,7 +156,13 @@ |
157 | 157 | |
158 | 158 | return $title->getFullURL( $query ); |
159 | 159 | } |
| 160 | + |
| 161 | + static function linkInContextCanonicalURL( $thread, $contextType = 'page' ) { |
| 162 | + list( $title, $query ) = self::linkInContextData( $thread, $contextType ); |
160 | 163 | |
| 164 | + return $title->getCanonicalURL( $query ); |
| 165 | + } |
| 166 | + |
161 | 167 | static function diffQuery( $thread, $revision ) { |
162 | 168 | $changed_thread = $revision->getChangeObject(); |
163 | 169 | $curr_rev_id = $changed_thread->rootRevision(); |
Index: branches/wmf/1.17wmf1/extensions/LiquidThreads/classes/NewMessagesController.php |
— | — | @@ -307,7 +307,7 @@ |
308 | 308 | global $wgPasswordSender; |
309 | 309 | $link_title = clone $t->getTitle(); |
310 | 310 | $link_title->setFragment( '#' . $t->getAnchorName() ); |
311 | | - $permalink = LqtView::linkInContextURL( $t ); |
| 311 | + $permalink = LqtView::linkInContextCanonicalURL( $t ); |
312 | 312 | $talkPage = $t->getTitle()->getPrefixedText(); |
313 | 313 | $from = new MailAddress( $wgPasswordSender, 'WikiAdmin' ); |
314 | 314 | $threadSubject = $t->subject(); |
Index: branches/wmf/1.17wmf1/extensions/AbuseFilter/AbuseFilter.class.php |
— | — | @@ -1700,12 +1700,12 @@ |
1701 | 1701 | static function modifyActionText( $page, $type, $title, $sk, $args ) { |
1702 | 1702 | list( $history_id, $filter_id ) = $args; |
1703 | 1703 | |
1704 | | - $filter_link = $sk ? $sk->link( $title ) : $title->getFullURL(); |
| 1704 | + $filter_link = $sk ? $sk->link( $title ) : $title->getCanonicalURL(); |
1705 | 1705 | |
1706 | 1706 | $details_title = SpecialPage::getTitleFor( 'AbuseFilter', "history/$filter_id/diff/prev/$history_id" ); |
1707 | 1707 | $details_text = wfMsgExt( 'abusefilter-log-detailslink', 'parseinline' ); |
1708 | 1708 | $details_link = |
1709 | | - $sk ? $sk->link( $details_title, $details_text ) : $details_title->getFullURL(); |
| 1709 | + $sk ? $sk->link( $details_title, $details_text ) : $details_title->getCanonicalURL(); |
1710 | 1710 | |
1711 | 1711 | return wfMsgExt( 'abusefilter-log-entry-modify', |
1712 | 1712 | array( 'parseinline', 'replaceafter' ), array( $filter_link, $details_link ) ); |
Index: branches/wmf/1.17wmf1/extensions/OpenSearchXml/ApiOpenSearchXml.php |
— | — | @@ -103,11 +103,11 @@ |
104 | 104 | |
105 | 105 | $item['Text']['*'] = $title->getPrefixedText(); |
106 | 106 | $item['Description']['*'] = $extract; |
107 | | - $item['Url']['*'] = $title->getFullUrl(); |
| 107 | + $item['Url']['*'] = wfExpandUrl( $title->getFullUrl(), PROTO_CURRENT ); |
108 | 108 | if( $image ) { |
109 | 109 | $thumb = $image->transform( array( 'width' => 50, 'height' => 50 ), 0 ); |
110 | 110 | $item['Image'] = array( |
111 | | - 'source' => wfExpandUrl( $thumb->getUrl() ), |
| 111 | + 'source' => wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ), |
112 | 112 | //alt |
113 | 113 | 'width' => $thumb->getWidth(), |
114 | 114 | 'height' => $thumb->getHeight() ); |
Index: branches/wmf/1.17wmf1/extensions/Collection/Collection.php |
— | — | @@ -219,12 +219,12 @@ |
220 | 220 | $r = new AjaxResponse(); |
221 | 221 | if ( $redirect ) { |
222 | 222 | $title = Title::newFromText( $redirect ); |
223 | | - $redirecturl = $title->getFullURL(); |
| 223 | + $redirecturl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ); |
224 | 224 | $r->setResponseCode( 302 ); |
225 | 225 | header( 'Location: ' . $redirecturl ); |
226 | 226 | } else { |
227 | 227 | $title = SpecialPage::getTitleFor( 'Book' ); |
228 | | - $redirecturl = $title->getFullURL(); |
| 228 | + $redirecturl = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT ); |
229 | 229 | $r->setContentType( 'application/json' ); |
230 | 230 | $r->addText( $json->encode( array( 'redirect_url' => $redirecturl ) ) ); |
231 | 231 | } |
Index: branches/wmf/1.17wmf1/extensions/Collection/Collection.body.php |
— | — | @@ -581,7 +581,7 @@ |
582 | 582 | 'revision' => strval( $oldid ), |
583 | 583 | 'latest' => strval( $latest ), |
584 | 584 | 'timestamp' => wfTimestamp( TS_UNIX, $revision->mTimestamp ), |
585 | | - 'url' => $title->getFullURL(), |
| 585 | + 'url' => $title->getCanonicalURL(), |
586 | 586 | 'currentVersion' => $currentVersion, |
587 | 587 | ); |
588 | 588 | |
— | — | @@ -766,7 +766,7 @@ |
767 | 767 | 'latest' => $latest, |
768 | 768 | 'revision' => $oldid, |
769 | 769 | 'timestamp' => wfTimestamp( TS_UNIX, $revision->mTimestamp ), |
770 | | - 'url' => $articleTitle->getFullURL(), |
| 770 | + 'url' => $articleTitle->getCanonicalURL(), |
771 | 771 | 'currentVersion' => $currentVersion, |
772 | 772 | ); |
773 | 773 | if ( $displayTitle ) { |
— | — | @@ -956,7 +956,7 @@ |
957 | 957 | |
958 | 958 | $response = self::mwServeCommand( 'render', array( |
959 | 959 | 'metabook' => $this->buildJSONCollection( $collection ), |
960 | | - 'base_url' => wfExpandUrl( $wgScriptPath ), |
| 960 | + 'base_url' => wfExpandUrl( $wgScriptPath, PROTO_CANONICAL ), |
961 | 961 | 'script_extension' => $wgScriptExtension, |
962 | 962 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
963 | 963 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
— | — | @@ -989,7 +989,7 @@ |
990 | 990 | |
991 | 991 | $response = self::mwServeCommand( 'render', array( |
992 | 992 | 'collection_id' => $collectionID, |
993 | | - 'base_url' => wfExpandUrl( $wgScriptPath ), |
| 993 | + 'base_url' => wfExpandUrl( $wgScriptPath, PROTO_CANONICAL ), |
994 | 994 | 'script_extension' => $wgScriptExtension, |
995 | 995 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
996 | 996 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
— | — | @@ -1071,7 +1071,7 @@ |
1072 | 1072 | $wgOut->setPageTitle( wfMsg( 'coll-rendering_finished_title' ) ); |
1073 | 1073 | |
1074 | 1074 | $template = new CollectionFinishedTemplate(); |
1075 | | - $template->set( 'download_url', wfExpandUrl( SkinTemplate::makeSpecialUrl( 'Book', 'bookcmd=download&' . $query ) ) ); |
| 1075 | + $template->set( 'download_url', wfExpandUrl( SkinTemplate::makeSpecialUrl( 'Book', 'bookcmd=download&' . $query ), PROTO_CURRENT ) ); |
1076 | 1076 | $template->set( 'is_cached', $wgRequest->getVal( 'is_cached' ) ); |
1077 | 1077 | $template->set( 'query', $query ); |
1078 | 1078 | $template->set( 'return_to', $return_to ); |
— | — | @@ -1161,7 +1161,7 @@ |
1162 | 1162 | |
1163 | 1163 | $response = self::mwServeCommand( 'zip_post', array( |
1164 | 1164 | 'metabook' => $this->buildJSONCollection( $collection ), |
1165 | | - 'base_url' => wfExpandUrl( $wgScriptPath ), |
| 1165 | + 'base_url' => wfExpandUrl( $wgScriptPath, PROTO_CANONICAL ), |
1166 | 1166 | 'script_extension' => $wgScriptExtension, |
1167 | 1167 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
1168 | 1168 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
— | — | @@ -1282,7 +1282,7 @@ |
1283 | 1283 | curl_setopt( $c, CURLOPT_HTTPHEADER, array( 'Expect:' ) ); |
1284 | 1284 | curl_setopt( $c, CURLOPT_HEADER, false ); |
1285 | 1285 | if ( is_object( $wgTitle ) ) { |
1286 | | - curl_setopt( $c, CURLOPT_REFERER, $wgTitle->getFullURL() ); |
| 1286 | + curl_setopt( $c, CURLOPT_REFERER, wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) ); |
1287 | 1287 | } |
1288 | 1288 | if ( $timeout ) { |
1289 | 1289 | curl_setopt( $c, CURLOPT_TIMEOUT, $wgHTTPTimeout ); |
Index: branches/wmf/1.17wmf1/extensions/OAI/OAIRepo_body.php |
— | — | @@ -550,7 +550,7 @@ |
551 | 551 | |
552 | 552 | function baseUrl() { |
553 | 553 | $title =& SpecialPage::getTitleFor( 'OAIRepository' ); |
554 | | - return $title->getFullUrl(); |
| 554 | + return $title->getCanonicalUrl(); |
555 | 555 | } |
556 | 556 | |
557 | 557 | function earliestDatestamp() { |
— | — | @@ -831,7 +831,7 @@ |
832 | 832 | oaiTag( 'dc:language', array(), $wgContLanguageCode ) . "\n" . |
833 | 833 | oaiTag( 'dc:type', array(), 'Text' ) . "\n" . |
834 | 834 | oaiTag( 'dc:format', array(), $wgMimeType ) . "\n" . |
835 | | - oaiTag( 'dc:identifier', array(), $title->getFullUrl() ) . "\n" . |
| 835 | + oaiTag( 'dc:identifier', array(), $title->getCanonicalUrl() ) . "\n" . |
836 | 836 | oaiTag( 'dc:contributor', array(), $this->_row->rev_user_text ) . "\n" . |
837 | 837 | oaiTag( 'dc:date', array(), oaiDatestamp( $this->getDatestamp() ) ) . "\n" . |
838 | 838 | "</oai_dc:dc>\n"; |
Index: branches/wmf/1.17wmf1/extensions/SecurePoll/includes/entities/Election.php |
— | — | @@ -363,7 +363,7 @@ |
364 | 364 | Xml::element( 'auth', array(), 'local' ) . "\n" . |
365 | 365 | Xml::element( 'property', |
366 | 366 | array( 'name' => 'jump-url' ), |
367 | | - $this->context->getSpecialTitle()->getFullURL() |
| 367 | + $this->context->getSpecialTitle()->getCanonicalUrl() |
368 | 368 | ) . "\n" . |
369 | 369 | Xml::element( 'property', |
370 | 370 | array( 'name' => 'jump-id' ), |
Index: branches/wmf/1.17wmf1/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/wmf/1.17wmf1/extensions/SpamBlacklist/SpamBlacklist_body.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | | - $thisHttp = $title->getFullUrl( 'action=raw' ); |
| 40 | + $thisHttp = wfExpandUrl( $title->getFullUrl( 'action=raw' ), PROTO_HTTP ); |
41 | 41 | $thisHttpRegex = '/^' . preg_quote( $thisHttp, '/' ) . '(?:&.*)?$/'; |
42 | 42 | |
43 | 43 | foreach( $this->files as $fileName ) { |
Index: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php |
— | — | @@ -53,7 +53,7 @@ |
54 | 54 | $htmlOut .= Xml::element( 'h2', null, wfMsg( 'centralnotice-view-logs' ) ); |
55 | 55 | $htmlOut .= Xml::openElement( 'div', array( 'id' => 'cn-log-switcher' ) ); |
56 | 56 | $title = SpecialPage::getTitleFor( 'CentralNoticeLogs' ); |
57 | | - $fullUrl = $title->getFullUrl(); |
| 57 | + $fullUrl = wfExpandUrl( $title->getFullUrl(), PROTO_CURRENT ); |
58 | 58 | |
59 | 59 | $htmlOut .= Xml::radio( |
60 | 60 | 'log_type', |
Property changes on: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
61 | 61 | Merged /trunk/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php:r95652-95653,95656,95659,95663,95855 |
62 | 62 | Merged /trunk/phase3/extensions/CentralNotice/special/SpecialCentralNoticeLogs.php:r95627,95651 |
Index: branches/wmf/1.17wmf1/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; |
— | — | @@ -214,7 +214,7 @@ |
215 | 215 | $stripped = $this->_stripMarkup( $inside ); // strip internal markup and <h[1-6]> |
216 | 216 | $header = UtfNormal::cleanUp( $stripped ); |
217 | 217 | $anchor = EditPage::sectionAnchor( $header ); |
218 | | - $url = $this->title->getFullUrl() . $anchor; |
| 218 | + $url = $this->title->getCanonicalUrl() . $anchor; |
219 | 219 | $headers[$header] = $url; |
220 | 220 | } |
221 | 221 | return $headers; |
— | — | @@ -237,7 +237,7 @@ |
238 | 238 | $links = array(); |
239 | 239 | while ( $row = $dbr->fetchObject( $result ) ) { |
240 | 240 | $category = Title::makeTitle( NS_CATEGORY, $row->cl_to ); |
241 | | - $links[$category->getText()] = $category->getFullUrl(); |
| 241 | + $links[$category->getText()] = $category->getCanonicalUrl(); |
242 | 242 | } |
243 | 243 | $dbr->freeResult( $result ); |
244 | 244 | |
Index: branches/wmf/1.17wmf1/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/wmf/1.17wmf1/extensions/EmailCapture/api/ApiEmailCapture.php |
— | — | @@ -33,8 +33,8 @@ |
34 | 34 | // Send auto-response |
35 | 35 | global $wgUser, $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/wmf/1.17wmf1/extensions/SiteMatrix/SiteMatrixApi.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | if ( $matrix->exist( $lang, $site ) ) { |
48 | 48 | $url = $matrix->getUrl( $lang, $site ); |
49 | 49 | $site_out = array( |
50 | | - 'url' => wfExpandUrl( $url ), |
| 50 | + 'url' => $url, |
51 | 51 | 'code' => $site, |
52 | 52 | ); |
53 | 53 | if( $matrix->isClosed( $lang, $site ) ) { |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | $url = $matrix->getUrl( $lang, $site ); |
70 | 70 | |
71 | 71 | $wiki = array(); |
72 | | - $wiki['url'] = wfExpandUrl( $url ); |
| 72 | + $wiki['url'] = $url; |
73 | 73 | $wiki['code'] = str_replace( '_', '-', $lang ) . ( $site != 'wiki' ? $site : '' ); |
74 | 74 | |
75 | 75 | if( $matrix->isPrivate( $lang . $site ) ) { |
Index: branches/wmf/1.17wmf1/extensions/SiteMatrix/SiteMatrix_body.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | global $wgConf; |
133 | 133 | $dbname = $minor . $major; |
134 | 134 | $minor = str_replace( '_', '-', $minor ); |
135 | | - return $wgConf->get( 'wgServer', $dbname, $major, |
| 135 | + return $wgConf->get( 'wgCanonicalServer', $dbname, $major, |
136 | 136 | array( 'lang' => $minor, 'site' => $major ) ); |
137 | 137 | } |
138 | 138 | |
Index: branches/wmf/1.17wmf1/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/wmf/1.17wmf1/extensions/CodeReview/backend/CodeRevision.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1290 | 1292 | Merged /trunk/extensions/CodeReview/backend/CodeRevision.php:r95652-95653,95656,95659,95663,95855 |
1291 | 1293 | Merged /trunk/phase3/extensions/CodeReview/backend/CodeRevision.php:r95627,95651 |
Index: branches/wmf/1.17wmf1/extensions/CodeReview/tests/CodeReviewTest.php |
— | — | @@ -40,4 +40,28 @@ |
41 | 41 | |
42 | 42 | // $this->assertEquals( '', $formatter->link( '' ) ); |
43 | 43 | } |
44 | | -} |
\ No newline at end of file |
| 44 | +} |
| 45 | + public function testCommentCanonicalUrl() { |
| 46 | + # Fixture: |
| 47 | + $repo = $this->createRepo(); |
| 48 | + $cr = CodeRevision::newFromSvn( $repo, array( |
| 49 | + 'rev' => 305, |
| 50 | + 'author' => 'hashar', |
| 51 | + 'date' => '15 august 2011', |
| 52 | + 'msg' => 'dumb revision message', |
| 53 | + 'paths' => array( '/dev/null' ), |
| 54 | + ) |
| 55 | + ); |
| 56 | + |
| 57 | + # Find out our revision root URL |
| 58 | + $baseUrl = SpecialPage::getTitleFor( 'Code', $repo->getName().'/305' )->getCanonicalUrl(); |
| 59 | + |
| 60 | + # Test revision URL with various comment id: |
| 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 | + } |
| 68 | +} |
Index: branches/wmf/1.17wmf1/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/wmf/1.17wmf1/extensions/ContributionTracking/tests/ContributionTrackingAPITest.php |
— | — | @@ -90,7 +90,7 @@ |
91 | 91 | 'business' => 'donations@wikimedia.org', |
92 | 92 | 'item_number' => 'DONATE', |
93 | 93 | 'no_note' => 0, |
94 | | - 'return' => $returnTitle->getFullUrl(), |
| 94 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), |
95 | 95 | 'currency_code' => 'USD', |
96 | 96 | 'cmd' => '_xclick', |
97 | 97 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | 'business' => 'donations@wikimedia.org', |
126 | 126 | 'item_number' => 'DONATE', |
127 | 127 | 'no_note' => 0, |
128 | | - 'return' => $returnTitle->getFullUrl(), |
| 128 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), |
129 | 129 | 'currency_code' => 'USD', |
130 | 130 | 'cmd' => '_xclick', |
131 | 131 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | 'business' => 'donations@wikimedia.org', |
173 | 173 | 'item_number' => 'DONATE', |
174 | 174 | 'no_note' => 0, |
175 | | - 'return' => $returnTitle->getFullUrl(), //Important to the language test. |
| 175 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), //Important to the language test. |
176 | 176 | 'currency_code' => 'USD', |
177 | 177 | 'cmd' => '_xclick', |
178 | 178 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
— | — | @@ -209,7 +209,7 @@ |
210 | 210 | 'business' => 'donations@wikimedia.org', |
211 | 211 | 'item_number' => 'DONATE', |
212 | 212 | 'no_note' => 0, |
213 | | - 'return' => $returnTitle->getFullUrl(), |
| 213 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), |
214 | 214 | 'currency_code' => 'USD', |
215 | 215 | 'cmd' => '_xclick', |
216 | 216 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
Index: branches/wmf/1.17wmf1/extensions/ContributionTracking/tests/ContributionTrackingProcessorTest.php |
— | — | @@ -196,7 +196,7 @@ |
197 | 197 | 'business' => 'donations@wikimedia.org', |
198 | 198 | 'item_number' => 'DONATE', |
199 | 199 | 'no_note' => 0, |
200 | | - 'return' => $returnTitle->getFullUrl(), |
| 200 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), |
201 | 201 | 'currency_code' => 'USD', |
202 | 202 | 'cmd' => '_xclick', |
203 | 203 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
— | — | @@ -261,7 +261,7 @@ |
262 | 262 | 'business' => 'donations@wikimedia.org', |
263 | 263 | 'item_number' => 'DONATE', |
264 | 264 | 'no_note' => 0, |
265 | | - 'return' => $returnTitle->getFullURL(), //Important to the language test. |
| 265 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), //Important to the language test. |
266 | 266 | 'currency_code' => 'USD', |
267 | 267 | 'cmd' => '_xclick', |
268 | 268 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
— | — | @@ -288,7 +288,7 @@ |
289 | 289 | 'business' => 'donations@wikimedia.org', |
290 | 290 | 'item_number' => 'DONATE', |
291 | 291 | 'no_note' => 0, |
292 | | - 'return' => $returnTitle->getFullURL(), |
| 292 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), |
293 | 293 | 'currency_code' => 'USD', |
294 | 294 | 'cmd' => '_xclick', |
295 | 295 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
Index: branches/wmf/1.17wmf1/extensions/ContributionTracking/tests/ContributionTrackingTest.php |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | 'business' => 'donations@wikimedia.org', |
115 | 115 | 'item_number' => 'DONATE', |
116 | 116 | 'no_note' => 0, |
117 | | - 'return' => $returnTitle->getFullUrl(), |
| 117 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), |
118 | 118 | 'currency_code' => 'USD', |
119 | 119 | 'cmd' => '_xclick', |
120 | 120 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
— | — | @@ -147,7 +147,7 @@ |
148 | 148 | 'business' => 'donations@wikimedia.org', |
149 | 149 | 'item_number' => 'DONATE', |
150 | 150 | 'no_note' => 0, |
151 | | - 'return' => $returnTitle->getFullUrl(), |
| 151 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), |
152 | 152 | 'currency_code' => 'USD', |
153 | 153 | 'cmd' => '_xclick', |
154 | 154 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
— | — | @@ -194,7 +194,7 @@ |
195 | 195 | 'business' => 'donations@wikimedia.org', |
196 | 196 | 'item_number' => 'DONATE', |
197 | 197 | 'no_note' => 0, |
198 | | - 'return' => $returnTitle->getFullUrl(), //Important to the language test. |
| 198 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), //Important to the language test. |
199 | 199 | 'currency_code' => 'USD', |
200 | 200 | 'cmd' => '_xclick', |
201 | 201 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
— | — | @@ -233,7 +233,7 @@ |
234 | 234 | 'business' => 'donations@wikimedia.org', |
235 | 235 | 'item_number' => 'DONATE', |
236 | 236 | 'no_note' => 0, |
237 | | - 'return' => $returnTitle->getFullUrl(), |
| 237 | + 'return' => wfExpandUrl( $returnTitle->getFullUrl(), PROTO_HTTP ), |
238 | 238 | 'currency_code' => 'USD', |
239 | 239 | 'cmd' => '_xclick', |
240 | 240 | 'notify_url' => 'https://civicrm.wikimedia.org/fundcore_gateway/paypal', |
Index: branches/wmf/1.17wmf1/extensions/ContributionTracking/ContributionTracking.processor.php |
— | — | @@ -322,7 +322,7 @@ |
323 | 323 | $returnText = $input['return']; |
324 | 324 | $returnTitle = Title::newFromText( $returnText ); |
325 | 325 | if ( $returnTitle ) { |
326 | | - $returnto = $returnTitle->getFullUrl(); |
| 326 | + $returnto = wfExpandUrl( $returnTitle->getFullUrl(), PROTO_CURRENT ); |
327 | 327 | } else { |
328 | 328 | $returnto = $wgContributionTrackingReturnToURLDefault . "/$language"; |
329 | 329 | } |
Index: branches/wmf/1.17wmf1/extensions/CentralAuth/CentralAuthUser.php |
— | — | @@ -1179,8 +1179,7 @@ |
1180 | 1180 | protected static function getIRCLine( $userpage, $wikiID ) { |
1181 | 1181 | $title = RecentChange::cleanupForIRC( $userpage->getPrefixedText() ); |
1182 | 1182 | $wikiID = RecentChange::cleanupForIRC( $wikiID ); |
1183 | | - // FIXME: *HACK* should be getFullURL(), hacked for SSL madness |
1184 | | - $url = $userpage->getInternalURL(); |
| 1183 | + $url = $userpage->getCanonicalURL(); |
1185 | 1184 | $user = RecentChange::cleanupForIRC( $userpage->getText() ); |
1186 | 1185 | # see http://www.irssi.org/documentation/formats for some colour codes. prefix is \003, |
1187 | 1186 | # no colour (\003) switches back to the term default |
Property changes on: branches/wmf/1.17wmf1/extensions/CentralAuth/CentralAuthUser.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1188 | 1187 | Merged /trunk/extensions/CentralAuth/CentralAuthUser.php:r95652-95653,95656,95659,95663,95855 |
1189 | 1188 | Merged /trunk/phase3/extensions/CentralAuth/CentralAuthUser.php:r95627,95651 |
Index: branches/wmf/1.17wmf1/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/wmf/1.17wmf1/includes/Title.php |
— | — | @@ -1008,13 +1008,15 @@ |
1009 | 1009 | * e-mail notifications. Uses $wgCanonicalServer and the |
1010 | 1010 | * GetCanonicalURL hook. |
1011 | 1011 | * |
| 1012 | + * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment |
| 1013 | + * |
1012 | 1014 | * @param $query string An optional query string |
1013 | 1015 | * @param $variant string Language variant of URL (for sr, zh, ...) |
1014 | 1016 | * @return string The URL |
1015 | 1017 | */ |
1016 | 1018 | public function getCanonicalURL( $query = '', $variant = false ) { |
1017 | 1019 | global $wgCanonicalServer; |
1018 | | - $url = $wgCanonicalServer . $this->getLocalURL( $query, $variant ); |
| 1020 | + $url = $wgCanonicalServer . $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL(); |
1019 | 1021 | wfRunHooks( 'GetCanonicalURL', array( &$this, &$url, $query ) ); |
1020 | 1022 | return $url; |
1021 | 1023 | } |
Property changes on: branches/wmf/1.17wmf1/includes/Title.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1022 | 1024 | Merged /trunk/phase3/includes/Title.php:r95627,95651 |