$entry['lang'] = $bits[0];
if ( $title ) {
- $entry['url'] = $title->getFullURL();
+ $entry['url'] = wfExpandUrl( $title->getFullURL() );
}
$this->getResult()->setContent( $entry, $bits[1] );
$result[] = $entry;
$title = Title::newFromText( "{$prefix}:{$title}" );
if ( $title ) {
- $entry['url'] = $title->getFullURL();
+ $entry['url'] = wfExpandUrl( $title->getFullURL() );
}
$this->getResult()->setContent( $entry, $title->getFullText() );
);
if ( $this->iwUrl ) {
$title = Title::newFromText( $rawTitleStr );
- $item['url'] = $title->getFullURL();
+ $item['url'] = wfExpandUrl( $title->getFullURL() );
}
$intrwValues[] = $item;
}
ApiQueryBase::addTitleInfo( $vals, $title );
}
if ( $fld_url ) {
+ // We *could* run this through wfExpandUrl() but I think it's better to output the link verbatim, even if it's protocol-relative --Roan
$vals['url'] = $row->el_to;
}
$fit = $result->addValue( array( 'query', $this->getModuleName() ), null, $vals );
foreach ( $wgUrlProtocols as $p ) {
$protocols[] = substr( $p, 0, strpos( $p, ':' ) );
}
- return $protocols;
+ return $protocols;
}
public static function getProtocolPrefix( $protocol ) {
break;
}
$entry = array();
+ // We *could* run this through wfExpandUrl() but I think it's better to output the link verbatim, even if it's protocol-relative --Roan
ApiResult::setContent( $entry, $row->el_to );
$fit = $this->addPageSubItem( $row->el_from, $entry );
if ( !$fit ) {
if ( !is_null( $params['url'] ) ) {
$title = Title::newFromText( "{$row->iwl_prefix}:{$row->iwl_title}" );
if ( $title ) {
- $entry['url'] = $title->getFullURL();
+ $entry['url'] = wfExpandUrl( $title->getFullURL() );
}
}
$vals['thumberror'] = $mto->toText();
}
}
- $vals['url'] = $file->getFullURL();
+ $vals['url'] = wfExpandUrl( $file->getFullURL() );
$vals['descriptionurl'] = wfExpandUrl( $file->getDescriptionUrl() );
}
}
if ( $this->fld_url ) {
- $pageInfo['fullurl'] = $title->getFullURL();
- $pageInfo['editurl'] = $title->getFullURL( 'action=edit' );
+ $pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL() );
+ $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ) );
}
if ( $this->fld_readable && $title->userCanRead() ) {
$pageInfo['readable'] = '';
if ( $params['url'] ) {
$title = Title::newFromText( "{$row->ll_lang}:{$row->ll_title}" );
if ( $title ) {
- $entry['url'] = $title->getFullURL();
+ $entry['url'] = wfExpandUrl( $title->getFullURL() );
}
}
ApiResult::setContent( $entry, $row->ll_title );
$data = array();
$mainPage = Title::newMainPage();
$data['mainpage'] = $mainPage->getPrefixedText();
- $data['base'] = $mainPage->getFullUrl();
+ $data['base'] = wfExpandUrl( $mainPage->getFullUrl() );
$data['sitename'] = $GLOBALS['wgSitename'];
$data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}";
$data['phpversion'] = phpversion();
if ( isset( $langNames[$row->iw_prefix] ) ) {
$val['language'] = $langNames[$row->iw_prefix];
}
- $val['url'] = $row->iw_url;
+ $val['url'] = wfExpandUrl( $row->iw_url );
$val['wikiid'] = $row->iw_wikiid;
$val['api'] = $row->iw_api;
protected function appendRightsInfo( $property ) {
global $wgRightsPage, $wgRightsUrl, $wgRightsText;
$title = Title::newFromText( $wgRightsPage );
- $url = $title ? $title->getFullURL() : $wgRightsUrl;
+ $url = $title ? wfExpandUrl( $title->getFullURL() ) : $wgRightsUrl;
$text = $wgRightsText;
if ( !$text && $title ) {
$text = $title->getPrefixedText();