Index: trunk/phase3/includes/media/Generic.php |
— | — | @@ -141,6 +141,18 @@ |
142 | 142 | * @return array thumbnail extension and MIME type |
143 | 143 | */ |
144 | 144 | function getThumbType( $ext, $mime, $params = null ) { |
| 145 | + $magic = MimeMagic::singleton(); |
| 146 | + if ( !$ext || $magic->isMatchingExtension( $ext, $mime ) === false ) { |
| 147 | + // The extension is not valid for this mime type and we do |
| 148 | + // recognize the mime type |
| 149 | + $extensions = $magic->getExtensionsForType( $mime ); |
| 150 | + if ( $extensions ) { |
| 151 | + return array( strtok( $extensions, ' ' ), $mime ); |
| 152 | + } |
| 153 | + } |
| 154 | + |
| 155 | + // The extension is correct (true) or the mime type is unknown to |
| 156 | + // MediaWiki (null) |
145 | 157 | return array( $ext, $mime ); |
146 | 158 | } |
147 | 159 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -119,6 +119,8 @@ |
120 | 120 | enabled, but user cannot see rc patrol links. |
121 | 121 | * (bug 26548) ForeignAPIRepo (InstantCommons) now works with PDF files |
122 | 122 | and other multi-paged file formats. |
| 123 | +* Files with a mime type that does not match the extension are now properly |
| 124 | + thumbnailed |
123 | 125 | |
124 | 126 | === API changes in 1.18 === |
125 | 127 | * (bug 26339) Throw warning when truncating an overlarge API result |