Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | $data = array(); |
119 | 119 | $mainPage = Title::newMainPage(); |
120 | 120 | $data['mainpage'] = $mainPage->getPrefixedText(); |
121 | | - $data['base'] = $mainPage->getFullUrl(); |
| 121 | + $data['base'] = wfExpandUrl( $mainPage->getFullUrl() ); |
122 | 122 | $data['sitename'] = $GLOBALS['wgSitename']; |
123 | 123 | $data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}"; |
124 | 124 | $data['phpversion'] = phpversion(); |
— | — | @@ -284,7 +284,7 @@ |
285 | 285 | if ( isset( $langNames[$row->iw_prefix] ) ) { |
286 | 286 | $val['language'] = $langNames[$row->iw_prefix]; |
287 | 287 | } |
288 | | - $val['url'] = $row->iw_url; |
| 288 | + $val['url'] = wfExpandUrl( $row->iw_url ); |
289 | 289 | $val['wikiid'] = $row->iw_wikiid; |
290 | 290 | $val['api'] = $row->iw_api; |
291 | 291 | |
— | — | @@ -448,7 +448,7 @@ |
449 | 449 | protected function appendRightsInfo( $property ) { |
450 | 450 | global $wgRightsPage, $wgRightsUrl, $wgRightsText; |
451 | 451 | $title = Title::newFromText( $wgRightsPage ); |
452 | | - $url = $title ? $title->getFullURL() : $wgRightsUrl; |
| 452 | + $url = $title ? wfExpandUrl( $title->getFullURL() ) : $wgRightsUrl; |
453 | 453 | $text = $wgRightsText; |
454 | 454 | if ( !$text && $title ) { |
455 | 455 | $text = $title->getPrefixedText(); |
Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -353,7 +353,7 @@ |
354 | 354 | |
355 | 355 | $entry['lang'] = $bits[0]; |
356 | 356 | if ( $title ) { |
357 | | - $entry['url'] = $title->getFullURL(); |
| 357 | + $entry['url'] = wfExpandUrl( $title->getFullURL() ); |
358 | 358 | } |
359 | 359 | $this->getResult()->setContent( $entry, $bits[1] ); |
360 | 360 | $result[] = $entry; |
— | — | @@ -435,7 +435,7 @@ |
436 | 436 | |
437 | 437 | $title = Title::newFromText( "{$prefix}:{$title}" ); |
438 | 438 | if ( $title ) { |
439 | | - $entry['url'] = $title->getFullURL(); |
| 439 | + $entry['url'] = wfExpandUrl( $title->getFullURL() ); |
440 | 440 | } |
441 | 441 | |
442 | 442 | $this->getResult()->setContent( $entry, $title->getFullText() ); |
Index: trunk/phase3/includes/api/ApiQueryExtLinksUsage.php |
— | — | @@ -126,6 +126,7 @@ |
127 | 127 | ApiQueryBase::addTitleInfo( $vals, $title ); |
128 | 128 | } |
129 | 129 | if ( $fld_url ) { |
| 130 | + // We *could* run this through wfExpandUrl() but I think it's better to output the link verbatim, even if it's protocol-relative --Roan |
130 | 131 | $vals['url'] = $row->el_to; |
131 | 132 | } |
132 | 133 | $fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $vals ); |
— | — | @@ -183,7 +184,7 @@ |
184 | 185 | foreach ( $wgUrlProtocols as $p ) { |
185 | 186 | $protocols[] = substr( $p, 0, strpos( $p, ':' ) ); |
186 | 187 | } |
187 | | - return $protocols; |
| 188 | + return $protocols; |
188 | 189 | } |
189 | 190 | |
190 | 191 | public static function getProtocolPrefix( $protocol ) { |
Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -374,7 +374,7 @@ |
375 | 375 | ); |
376 | 376 | if ( $this->iwUrl ) { |
377 | 377 | $title = Title::newFromText( $rawTitleStr ); |
378 | | - $item['url'] = $title->getFullURL(); |
| 378 | + $item['url'] = wfExpandUrl( $title->getFullURL() ); |
379 | 379 | } |
380 | 380 | $intrwValues[] = $item; |
381 | 381 | } |
Index: trunk/phase3/includes/api/ApiQueryIWLinks.php |
— | — | @@ -112,7 +112,7 @@ |
113 | 113 | if ( !is_null( $params['url'] ) ) { |
114 | 114 | $title = Title::newFromText( "{$row->iwl_prefix}:{$row->iwl_title}" ); |
115 | 115 | if ( $title ) { |
116 | | - $entry['url'] = $title->getFullURL(); |
| 116 | + $entry['url'] = wfExpandUrl( $title->getFullURL() ); |
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
Index: trunk/phase3/includes/api/ApiQueryLangLinks.php |
— | — | @@ -106,7 +106,7 @@ |
107 | 107 | if ( $params['url'] ) { |
108 | 108 | $title = Title::newFromText( "{$row->ll_lang}:{$row->ll_title}" ); |
109 | 109 | if ( $title ) { |
110 | | - $entry['url'] = $title->getFullURL(); |
| 110 | + $entry['url'] = wfExpandUrl( $title->getFullURL() ); |
111 | 111 | } |
112 | 112 | } |
113 | 113 | ApiResult::setContent( $entry, $row->ll_title ); |
Index: trunk/phase3/includes/api/ApiQueryImageInfo.php |
— | — | @@ -370,7 +370,7 @@ |
371 | 371 | $vals['thumberror'] = $mto->toText(); |
372 | 372 | } |
373 | 373 | } |
374 | | - $vals['url'] = $file->getFullURL(); |
| 374 | + $vals['url'] = wfExpandUrl( $file->getFullURL() ); |
375 | 375 | $vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl() ); |
376 | 376 | } |
377 | 377 | |
Index: trunk/phase3/includes/api/ApiQueryExternalLinks.php |
— | — | @@ -86,6 +86,7 @@ |
87 | 87 | break; |
88 | 88 | } |
89 | 89 | $entry = array(); |
| 90 | + // We *could* run this through wfExpandUrl() but I think it's better to output the link verbatim, even if it's protocol-relative --Roan |
90 | 91 | ApiResult::setContent( $entry, $row->el_to ); |
91 | 92 | $fit = $this->addPageSubItem( $row->el_from, $entry ); |
92 | 93 | if ( !$fit ) { |
Index: trunk/phase3/includes/api/ApiQueryInfo.php |
— | — | @@ -380,8 +380,8 @@ |
381 | 381 | } |
382 | 382 | |
383 | 383 | if ( $this->fld_url ) { |
384 | | - $pageInfo['fullurl'] = $title->getFullURL(); |
385 | | - $pageInfo['editurl'] = $title->getFullURL( 'action=edit' ); |
| 384 | + $pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL() ); |
| 385 | + $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ) ); |
386 | 386 | } |
387 | 387 | if ( $this->fld_readable && $title->userCanRead() ) { |
388 | 388 | $pageInfo['readable'] = ''; |