mediawiki.special.upload: trim nameToCheck
authorFomafix <fomafix@googlemail.com>
Sun, 21 Jan 2018 00:17:43 +0000 (01:17 +0100)
committerFomafix <fomafix@googlemail.com>
Sun, 21 Jan 2018 00:17:43 +0000 (01:17 +0100)
The API ignores titles consists only on spaces and returns a response
without a "query" key.

Bug: T185400
Change-Id: Ia365f6660c0da0138a9035aad8dfcda38fab7733

resources/src/mediawiki.special/mediawiki.special.upload.js

index 9bf6255..06cb2d8 100644 (file)
@@ -61,7 +61,7 @@
 
                timeout: function () {
                        var $spinnerDestCheck, title;
-                       if ( !ajaxUploadDestCheck || this.nameToCheck === '' ) {
+                       if ( !ajaxUploadDestCheck || this.nameToCheck.trim() === '' ) {
                                return;
                        }
                        $spinnerDestCheck = $.createSpinner().insertAfter( '#wpDestFile' );