Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -206,6 +206,7 @@ |
207 | 207 | 'mwe-upwiz-thanks-wikitext', |
208 | 208 | 'mwe-upwiz-thanks-url', |
209 | 209 | 'mwe-upwiz-upload-error-bad-filename-extension', |
| 210 | + 'mwe-upwiz-upload-error-bad-filename-no-extension', |
210 | 211 | 'mwe-upwiz-allowed-filename-extensions', |
211 | 212 | 'mwe-upwiz-help-allowed-filename-extensions', |
212 | 213 | 'mwe-upwiz-upload-error-duplicate', |
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -138,7 +138,8 @@ |
139 | 139 | 'mwe-upwiz-thanks-link' => 'This file is now available at <b><tt>$1</tt></b>.', |
140 | 140 | 'mwe-upwiz-thanks-wikitext' => '<b>To use the file in a wiki</b>, copy this text into a page:', |
141 | 141 | 'mwe-upwiz-thanks-url' => '<b>To link to it in HTML</b>, copy this URL address:', |
142 | | - 'mwe-upwiz-upload-error-bad-filename-extension' => 'This wiki does not accept filenames with the extension "$1".', |
| 142 | + 'mwe-upwiz-upload-error-bad-filename-extension' => 'This wiki does not accept filenames that end in the extension ".$1".', |
| 143 | + 'mwe-upwiz-upload-error-bad-filename-no-extension' => 'This wiki requires that files have an extension -- like ".JPG" at the end of the filename.', |
143 | 144 | 'mwe-upwiz-allowed-filename-extensions' => 'The allowed extensions are:', |
144 | 145 | 'mwe-upwiz-help-allowed-filename-extensions' => 'Allowed filename extensions', |
145 | 146 | 'mwe-upwiz-upload-error-duplicate' => 'This file was previously uploaded to this wiki.', |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js |
— | — | @@ -213,13 +213,18 @@ |
214 | 214 | _this.clearErrors(); |
215 | 215 | _this.upload.extractLocalFileInfo( _this.$fileInputCtrl.val() ); |
216 | 216 | var extension = _this.upload.title.getExtension(); |
217 | | - var isGoodExtension = $j.inArray( extension.toLowerCase(), mw.UploadWizard.config[ 'fileExtensions' ] ) !== -1; |
218 | | - if ( isGoodExtension ) { |
| 217 | + var hasExtension = ! mw.isEmpty( extension ); |
| 218 | + var isGoodExtension = false; |
| 219 | + if ( hasExtension ) { |
| 220 | + isGoodExtension = $j.inArray( extension.toLowerCase(), mw.UploadWizard.config[ 'fileExtensions' ] ) !== -1; |
| 221 | + } |
| 222 | + if ( hasExtension && isGoodExtension ) { |
219 | 223 | _this.updateFilename(); |
220 | 224 | } else { |
| 225 | + var errorMessage = hasExtension ? 'mwe-upwiz-upload-error-bad-filename-extension' : 'mwe-upwiz-upload-error-bad-filename-no-extension'; |
221 | 226 | $( '<div>' ) |
222 | 227 | .append( |
223 | | - $j( '<p>' ).msg( 'mwe-upwiz-upload-error-bad-filename-extension', extension ), |
| 228 | + $j( '<p>' ).msg( errorMessage, extension ), |
224 | 229 | $j( '<p>' ).msg( 'mwe-upwiz-allowed-filename-extensions' ), |
225 | 230 | $j( '<blockquote>' ).append( $j( '<tt>' ).append( |
226 | 231 | mw.UploadWizard.config[ 'fileExtensions' ].join( " " ) |