Fix a regression from the file repo stuff.
authorRaimond Spekking <raymond@users.mediawiki.org>
Mon, 3 Sep 2007 15:06:30 +0000 (15:06 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Mon, 3 Sep 2007 15:06:30 +0000 (15:06 +0000)
$file->getExtension returns now a normalized, lower case extension but the check needs the original extension from the upload input form.

includes/SpecialUpload.php

index a254a1d..fb3f446 100644 (file)
@@ -459,7 +459,7 @@ class UploadForm {
                // Check for uppercase extension. We allow these filenames but check if an image
                // with lowercase extension exists already
                $warning = '';
-               $ext = $file->getExtension();
+               $ext = substr( $file->getName(), strlen( $file->getName() ) - strlen( $file->getExtension() ), strlen( $file->getExtension() ) );
                $sk = $wgUser->getSkin();
                if ( $ext !== '' ) {
                        $partname = substr( $file->getName(), 0, -strlen( $ext ) - 1 );