InstantCommons
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Fri, 5 Nov 2010 16:36:50 +0000 (16:36 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Fri, 5 Nov 2010 16:36:50 +0000 (16:36 +0000)
* Use dbkey form of title, not textual form.
* Use getZonePath() from the repo.

includes/filerepo/ForeignAPIFile.php

index 464a852..d1e38ea 100644 (file)
@@ -24,7 +24,7 @@ class ForeignAPIFile extends File {
        
        static function newFromTitle( $title, $repo ) {
                $data = $repo->fetchImageQuery( array(
-                        'titles' => 'File:' . $title->getText(),
+                        'titles' => 'File:' . $title->getDBKey(),
                         'iiprop' => self::getProps(),
                         'prop' => 'imageinfo' ) );
 
@@ -155,7 +155,7 @@ class ForeignAPIFile extends File {
        function getThumbPath( $suffix = '' ) {
                if ( $this->repo->canCacheThumbs() ) {
                        global $wgUploadDirectory;
-                       $path = $wgUploadDirectory . '/thumb/' . $this->getHashPath( $this->getName() );
+                       $path = $this->repo->getZonePath('thumb') . '/' . $this->getHashPath( $this->getName() );
                        if ( $suffix ) {
                                $path = $path . $suffix . '/';
                        }