Revert r34877 -- duplicates wfExpandUrl()
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 15 May 2008 19:42:55 +0000 (19:42 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 15 May 2008 19:42:55 +0000 (19:42 +0000)
includes/HttpFunctions.php
includes/SpecialFilepath.php
includes/api/ApiQueryImageInfo.php

index 98e397a..555a79b 100644 (file)
@@ -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;
-       }
 }
index 30fa962..84412ab 100644 (file)
@@ -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 );
index 7f4fb76..fdb389f 100644 (file)
@@ -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();