Index: trunk/phase3/includes/filerepo/FileRepo.php |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | var $thumbScriptUrl, $transformVia404; |
17 | 17 | var $descBaseUrl, $scriptDirUrl, $articleUrl, $fetchDescription, $initialCapital; |
18 | 18 | var $pathDisclosureProtection = 'paranoid'; |
19 | | - var $descriptionCacheExpiry, $apiThumbCacheExpiry, $hashLevels, $fileNamespace; |
| 19 | + var $descriptionCacheExpiry, $apiThumbCacheExpiry, $hashLevels; |
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Factory functions for creating new files |
— | — | @@ -30,10 +30,9 @@ |
31 | 31 | |
32 | 32 | // Optional settings |
33 | 33 | $this->initialCapital = true; // by default |
34 | | - $this->fileNamespace = MWNamespace::getCanonicalName( NS_FILE ); // fallback to 'File' |
35 | 34 | foreach ( array( 'descBaseUrl', 'scriptDirUrl', 'articleUrl', 'fetchDescription', |
36 | 35 | 'thumbScriptUrl', 'initialCapital', 'pathDisclosureProtection', |
37 | | - 'descriptionCacheExpiry', 'apiThumbCacheExpiry', 'hashLevels', 'fileNamespace' ) as $var ) |
| 36 | + 'descriptionCacheExpiry', 'apiThumbCacheExpiry', 'hashLevels' ) as $var ) |
38 | 37 | { |
39 | 38 | if ( isset( $info[$var] ) ) { |
40 | 39 | $this->$var = $info[$var]; |
— | — | @@ -263,10 +262,10 @@ |
264 | 263 | if ( is_null( $this->descBaseUrl ) ) { |
265 | 264 | if ( !is_null( $this->articleUrl ) ) { |
266 | 265 | $this->descBaseUrl = str_replace( '$1', |
267 | | - wfUrlencode( $this->getFileNamespace() ) . ':', $this->articleUrl ); |
| 266 | + wfUrlencode( MWNamespace::getCanonicalName( NS_FILE ) ) . ':', $this->articleUrl ); |
268 | 267 | } elseif ( !is_null( $this->scriptDirUrl ) ) { |
269 | 268 | $this->descBaseUrl = $this->scriptDirUrl . '/index.php?title=' . |
270 | | - wfUrlencode( $this->getFileNamespace() ) . ':'; |
| 269 | + wfUrlencode( MWNamespace::getCanonicalName( NS_FILE ) ) . ':'; |
271 | 270 | } else { |
272 | 271 | $this->descBaseUrl = false; |
273 | 272 | } |
— | — | @@ -301,7 +300,7 @@ |
302 | 301 | function getDescriptionRenderUrl( $name ) { |
303 | 302 | if ( isset( $this->scriptDirUrl ) ) { |
304 | 303 | return $this->scriptDirUrl . '/index.php?title=' . |
305 | | - wfUrlencode( $this->getFileNamespace() . ':' . $name ) . |
| 304 | + wfUrlencode( MWNamespace::getCanonicalName( NS_FILE ) . ':' . $name ) . |
306 | 305 | '&action=render'; |
307 | 306 | } else { |
308 | 307 | $descBase = $this->getDescBaseUrl(); |
— | — | @@ -535,11 +534,4 @@ |
536 | 535 | function findBySha1( $hash ) { |
537 | 536 | return array(); |
538 | 537 | } |
539 | | - /** |
540 | | - * Returns the file namespace string |
541 | | - * @return string |
542 | | - */ |
543 | | - function getFileNamespace() { |
544 | | - return $this->fileNamespace; |
545 | | - } |
546 | 538 | } |
Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | |
96 | 96 | function getImageInfo( $title, $time = false ) { |
97 | 97 | return $this->queryImage( array( |
98 | | - 'titles' => $this->getFileNamespace() . ':' . $title->getText(), |
| 98 | + 'titles' => 'Image:' . $title->getText(), |
99 | 99 | 'iiprop' => 'timestamp|user|comment|url|size|sha1|metadata|mime' ) ); |
100 | 100 | } |
101 | 101 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -386,10 +386,6 @@ |
387 | 387 | * (bug 16026) 'Revision-info' and 'revision-info-current' both accept wiki |
388 | 388 | markup now. |
389 | 389 | * (bug 16529) Fix for search suggestions with some third-party JS libraries |
390 | | -* Foreign repositories (API or DB) would fail to fetch images and/or description |
391 | | - pages if the repo wiki had a different canonical name for the File: namespace. |
392 | | - Added 'fileNamespace' configuration item to $wgForeignFileRepos to override |
393 | | - the local canonical name 'File' with another string. |
394 | 390 | * (bug 13342) importScript() generates more consistent URI encoding |
395 | 391 | |
396 | 392 | |