Follow-up r76113, r76114: undeclared global, unnecessary global + some whitespace...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 5 Nov 2010 18:01:16 +0000 (18:01 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 5 Nov 2010 18:01:16 +0000 (18:01 +0000)
includes/filerepo/ForeignAPIFile.php
includes/filerepo/ForeignAPIRepo.php

index d1e38ea..9869188 100644 (file)
@@ -66,9 +66,9 @@ class ForeignAPIFile extends File {
                        return parent::transform( $params, $flags );
                }
                $thumbUrl = $this->repo->getThumbUrlFromCache(
-                               $this->getName(),
-                               isset( $params['width'] ) ? $params['width'] : -1,
-                               isset( $params['height'] ) ? $params['height'] : -1 );
+                       $this->getName(),
+                       isset( $params['width'] ) ? $params['width'] : -1,
+                       isset( $params['height'] ) ? $params['height'] : -1 );
                return $this->handler->getTransform( $this, 'bogus', $thumbUrl, $params );
        }
 
@@ -154,15 +154,13 @@ class ForeignAPIFile extends File {
         */
        function getThumbPath( $suffix = '' ) {
                if ( $this->repo->canCacheThumbs() ) {
-                       global $wgUploadDirectory;
                        $path = $this->repo->getZonePath('thumb') . '/' . $this->getHashPath( $this->getName() );
                        if ( $suffix ) {
                                $path = $path . $suffix . '/';
                        }
                        return $path;
-               }
-               else {
-                       return null;    
+               } else {
+                       return null;
                }
        }
        
index bf2b3dc..ddbfb00 100644 (file)
@@ -36,6 +36,7 @@ class ForeignAPIRepo extends FileRepo {
 
        function __construct( $info ) {
                parent::__construct( $info );
+               global $wgUploadDirectory;
 
                // http://commons.wikimedia.org/w/api.php
                $this->mApiBase = isset( $info['apibase'] ) ? $info['apibase'] : null;