From 541aa4cbdd4eb9c18e4e99bac034ace26008230c Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 3 Aug 2011 07:05:21 +0000 Subject: [PATCH] Followup r92044: force HTTP on URLs output by the API, now that wfExpandUrl() has a flag for this --- includes/api/ApiParse.php | 4 ++-- includes/api/ApiQuery.php | 2 +- includes/api/ApiQueryIWLinks.php | 2 +- includes/api/ApiQueryImageInfo.php | 2 +- includes/api/ApiQueryInfo.php | 4 ++-- includes/api/ApiQueryLangLinks.php | 2 +- includes/api/ApiQuerySiteinfo.php | 6 +++--- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 6450917ffc..0c674459b0 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -353,7 +353,7 @@ class ApiParse extends ApiBase { $entry['lang'] = $bits[0]; if ( $title ) { - $entry['url'] = wfExpandUrl( $title->getFullURL() ); + $entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_HTTP ); } $this->getResult()->setContent( $entry, $bits[1] ); $result[] = $entry; @@ -435,7 +435,7 @@ class ApiParse extends ApiBase { $title = Title::newFromText( "{$prefix}:{$title}" ); if ( $title ) { - $entry['url'] = wfExpandUrl( $title->getFullURL() ); + $entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_HTTP ); } $this->getResult()->setContent( $entry, $title->getFullText() ); diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index 61f18925ea..b9ee7fd382 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -374,7 +374,7 @@ class ApiQuery extends ApiBase { ); if ( $this->iwUrl ) { $title = Title::newFromText( $rawTitleStr ); - $item['url'] = wfExpandUrl( $title->getFullURL() ); + $item['url'] = wfExpandUrl( $title->getFullURL(), PROTO_HTTP ); } $intrwValues[] = $item; } diff --git a/includes/api/ApiQueryIWLinks.php b/includes/api/ApiQueryIWLinks.php index 547c40b56b..6f370518c6 100644 --- a/includes/api/ApiQueryIWLinks.php +++ b/includes/api/ApiQueryIWLinks.php @@ -112,7 +112,7 @@ class ApiQueryIWLinks extends ApiQueryBase { if ( $params['url'] ) { $title = Title::newFromText( "{$row->iwl_prefix}:{$row->iwl_title}" ); if ( $title ) { - $entry['url'] = wfExpandUrl( $title->getFullURL() ); + $entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_HTTP ); } } diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 3e435baa9f..fe239a974f 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -348,7 +348,7 @@ class ApiQueryImageInfo extends ApiQueryBase { if ( !is_null( $thumbParams ) ) { $mto = $file->transform( $thumbParams ); if ( $mto && !$mto->isError() ) { - $vals['thumburl'] = wfExpandUrl( $mto->getUrl() ); + $vals['thumburl'] = wfExpandUrl( $mto->getUrl(), PROTO_HTTP ); // bug 23834 - If the URL's are the same, we haven't resized it, so shouldn't give the wanted // thumbnail sizes for the thumbnail actual size diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 818de5cc70..c9e23093d9 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -380,8 +380,8 @@ class ApiQueryInfo extends ApiQueryBase { } if ( $this->fld_url ) { - $pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL() ); - $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ) ); + $pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL(), PROTO_HTTP ); + $pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ), PROTO_HTTP ); } if ( $this->fld_readable && $title->userCanRead() ) { $pageInfo['readable'] = ''; diff --git a/includes/api/ApiQueryLangLinks.php b/includes/api/ApiQueryLangLinks.php index 21a5dfd515..1468383f77 100644 --- a/includes/api/ApiQueryLangLinks.php +++ b/includes/api/ApiQueryLangLinks.php @@ -106,7 +106,7 @@ class ApiQueryLangLinks extends ApiQueryBase { if ( $params['url'] ) { $title = Title::newFromText( "{$row->ll_lang}:{$row->ll_title}" ); if ( $title ) { - $entry['url'] = wfExpandUrl( $title->getFullURL() ); + $entry['url'] = wfExpandUrl( $title->getFullURL(), PROTO_HTTP ); } } ApiResult::setContent( $entry, $row->ll_title ); diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 328decbae8..e1e1056da6 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -117,7 +117,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { $data = array(); $mainPage = Title::newMainPage(); $data['mainpage'] = $mainPage->getPrefixedText(); - $data['base'] = wfExpandUrl( $mainPage->getFullUrl() ); + $data['base'] = wfExpandUrl( $mainPage->getFullUrl(), PROTO_HTTP ); $data['sitename'] = $GLOBALS['wgSitename']; $data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}"; $data['phpversion'] = phpversion(); @@ -288,7 +288,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { if ( isset( $langNames[$prefix] ) ) { $val['language'] = $langNames[$prefix]; } - $val['url'] = wfExpandUrl( $row['iw_url'] ); + $val['url'] = wfExpandUrl( $row['iw_url'], PROTO_HTTP ); if( isset( $row['iw_wikiid'] ) ) { $val['wikiid'] = $row['iw_wikiid']; } @@ -456,7 +456,7 @@ class ApiQuerySiteinfo extends ApiQueryBase { protected function appendRightsInfo( $property ) { global $wgRightsPage, $wgRightsUrl, $wgRightsText; $title = Title::newFromText( $wgRightsPage ); - $url = $title ? wfExpandUrl( $title->getFullURL() ) : $wgRightsUrl; + $url = $title ? wfExpandUrl( $title->getFullURL(), PROTO_HTTP ) : $wgRightsUrl; $text = $wgRightsText; if ( !$text && $title ) { $text = $title->getPrefixedText(); -- 2.20.1