Index: trunk/phase3/includes/filerepo/RepoGroup.php |
— | — | @@ -100,10 +100,15 @@ |
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
| 104 | + if ( $title->getNamespace() != NS_MEDIA && $title->getNamespace() != NS_FILE ) { |
| 105 | + throw new MWException( __METHOD__ . ' recieved an Title object with incorrect namespace' ); |
| 106 | + } |
| 107 | + |
104 | 108 | # Check the cache |
105 | 109 | if ( empty( $options['ignoreRedirect'] ) |
106 | 110 | && empty( $options['private'] ) |
107 | | - && empty( $options['bypassCache'] ) ) |
| 111 | + && empty( $options['bypassCache'] ) |
| 112 | + && $title->getNamespace() == NS_FILE ) |
108 | 113 | { |
109 | 114 | $useCache = true; |
110 | 115 | $time = isset( $options['time'] ) ? $options['time'] : ''; |
Index: trunk/phase3/includes/ImageGallery.php |
— | — | @@ -244,9 +244,13 @@ |
245 | 245 | $time = $descQuery = false; |
246 | 246 | wfRunHooks( 'BeforeGalleryFindFile', array( &$this, &$nt, &$time, &$descQuery ) ); |
247 | 247 | |
248 | | - $img = wfFindFile( $nt, array( 'time' => $time ) ); |
| 248 | + if ( $nt->getNamespace() == NS_FILE ) { |
| 249 | + $img = wfFindFile( $nt, array( 'time' => $time ) ); |
| 250 | + } else { |
| 251 | + $img = false; |
| 252 | + } |
249 | 253 | |
250 | | - if( $nt->getNamespace() != NS_FILE || !$img ) { |
| 254 | + if( !$img ) { |
251 | 255 | # We're dealing with a non-image, spit out the name and be done with it. |
252 | 256 | $thumbhtml = "\n\t\t\t".'<div style="height: '.($this->mHeights*1.25+2).'px;">' |
253 | 257 | . htmlspecialchars( $nt->getText() ) . '</div>'; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -416,6 +416,10 @@ |
417 | 417 | * (bug 17789) Added a note to the total views on Special:Statistics saying that |
418 | 418 | is doesn't count non-existing pages and special pages |
419 | 419 | * (bug 17996) HTTP redirects are now combined when requesting a special page |
| 420 | +* (bug 19944) Link on image thumbnails no longer link to "Media:" namespace in |
| 421 | + some cases |
| 422 | +* (bug 25670) wfFindFile() now checks the namespace of the given title, only |
| 423 | + "File" and "Media" are allowed now |
420 | 424 | |
421 | 425 | === API changes in 1.17 === |
422 | 426 | * (bug 22738) Allow filtering by action type on query=logevent. |