Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php |
— | — | @@ -36,6 +36,7 @@ |
37 | 37 | |
38 | 38 | function __construct( $info ) { |
39 | 39 | parent::__construct( $info ); |
| 40 | + global $wgUploadDirectory; |
40 | 41 | |
41 | 42 | // http://commons.wikimedia.org/w/api.php |
42 | 43 | $this->mApiBase = isset( $info['apibase'] ) ? $info['apibase'] : null; |
Index: trunk/phase3/includes/filerepo/ForeignAPIFile.php |
— | — | @@ -66,9 +66,9 @@ |
67 | 67 | return parent::transform( $params, $flags ); |
68 | 68 | } |
69 | 69 | $thumbUrl = $this->repo->getThumbUrlFromCache( |
70 | | - $this->getName(), |
71 | | - isset( $params['width'] ) ? $params['width'] : -1, |
72 | | - isset( $params['height'] ) ? $params['height'] : -1 ); |
| 70 | + $this->getName(), |
| 71 | + isset( $params['width'] ) ? $params['width'] : -1, |
| 72 | + isset( $params['height'] ) ? $params['height'] : -1 ); |
73 | 73 | return $this->handler->getTransform( $this, 'bogus', $thumbUrl, $params ); |
74 | 74 | } |
75 | 75 | |
— | — | @@ -154,16 +154,14 @@ |
155 | 155 | */ |
156 | 156 | function getThumbPath( $suffix = '' ) { |
157 | 157 | if ( $this->repo->canCacheThumbs() ) { |
158 | | - global $wgUploadDirectory; |
159 | 158 | $path = $this->repo->getZonePath('thumb') . '/' . $this->getHashPath( $this->getName() ); |
160 | 159 | if ( $suffix ) { |
161 | 160 | $path = $path . $suffix . '/'; |
162 | 161 | } |
163 | 162 | return $path; |
| 163 | + } else { |
| 164 | + return null; |
164 | 165 | } |
165 | | - else { |
166 | | - return null; |
167 | | - } |
168 | 166 | } |
169 | 167 | |
170 | 168 | function getThumbnails() { |