From aca1bd92fa89ee13e155bb636ffe20339136a539 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 15 May 2008 19:42:55 +0000 Subject: [PATCH] Revert r34877 -- duplicates wfExpandUrl() --- includes/HttpFunctions.php | 16 ---------------- includes/SpecialFilepath.php | 3 +-- includes/api/ApiQueryImageInfo.php | 4 ++-- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 98e397a5e9..555a79b733 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -117,20 +117,4 @@ class Http { } return false; } - - /* - * Return the full url of something relative to $wgScriptPath or root - */ - static function makeFullURL( $url ) { - global $wgServer, $wgScriptPath; - - // This is a full url - if ( strpos( $url, '://' ) !== false ) return $url; - - // This is a relative path - if ( substr( $url, 0, 1 ) != '/' ) - $url = $wgScriptPath.'/'.$url; - - return $wgServer.$url; - } } diff --git a/includes/SpecialFilepath.php b/includes/SpecialFilepath.php index 30fa9623aa..84412ab616 100644 --- a/includes/SpecialFilepath.php +++ b/includes/SpecialFilepath.php @@ -13,8 +13,7 @@ function wfSpecialFilepath( $par ) { } else { $file = wfFindFile( $title ); if ( $file && $file->exists() ) { - // Force a real 30x so the real url is always exposed - $wgOut->redirect( Http::makeFullURL( $file->getURL() ) ); + $wgOut->redirect( $file->getURL() ); } else { $wgOut->setStatusCode( 404 ); $cform = new FilepathForm( $title ); diff --git a/includes/api/ApiQueryImageInfo.php b/includes/api/ApiQueryImageInfo.php index 7f4fb76979..fdb389f81c 100644 --- a/includes/api/ApiQueryImageInfo.php +++ b/includes/api/ApiQueryImageInfo.php @@ -129,12 +129,12 @@ class ApiQueryImageInfo extends ApiQueryBase { $thumb = $f->getThumbnail($this->urlwidth, $this->urlheight); if($thumb) { - $vals['thumburl'] = Http::makeFullUrl( $thumb->getURL() ); + $vals['thumburl'] = $thumb->getURL(); $vals['thumbwidth'] = $thumb->getWidth(); $vals['thumbheight'] = $thumb->getHeight(); } } - $vals['url'] = Http::makeFullUrl( $f->getURL() ); + $vals['url'] = $f->getURL(); } if($this->fld_comment) $vals['comment'] = $f->getDescription(); -- 2.20.1