Force output of a full URL in Special:Filepath and ApiQueryImageInfo in case the...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Thu, 15 May 2008 20:39:09 +0000 (20:39 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Thu, 15 May 2008 20:39:09 +0000 (20:39 +0000)
includes/SpecialFilepath.php
includes/api/ApiQueryImageInfo.php

index 84412ab..37703df 100644 (file)
@@ -13,7 +13,7 @@ function wfSpecialFilepath( $par ) {
        } else {
                $file = wfFindFile( $title );
                if ( $file && $file->exists() ) {
-                       $wgOut->redirect( $file->getURL() );
+                       $wgOut->redirect( wfExpandUrl( $file->getURL() ) );
                } else {
                        $wgOut->setStatusCode( 404 );
                        $cform = new FilepathForm( $title );
index fdb389f..b0d8289 100644 (file)
@@ -129,12 +129,12 @@ class ApiQueryImageInfo extends ApiQueryBase {
                                $thumb = $f->getThumbnail($this->urlwidth, $this->urlheight);
                                if($thumb)
                                {
-                                       $vals['thumburl'] = $thumb->getURL();
+                                       $vals['thumburl'] = wfExpandUrl( $thumb->getURL() );
                                        $vals['thumbwidth'] = $thumb->getWidth();
                                        $vals['thumbheight'] = $thumb->getHeight();
                                }
                        }
-                       $vals['url'] = $f->getURL();
+                       $vals['url'] = wfExpandUrl( $f->getURL() );
                }
                if($this->fld_comment)
                        $vals['comment'] = $f->getDescription();