Trim input url whitespace (#2534)

Fixes #2516
This commit is contained in:
Nishtha 2020-06-10 17:58:30 +05:30 committed by GitHub
parent 515d701973
commit cccaf2992a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,7 +91,9 @@ UrlImportingSourceUI.prototype.attachUI = function(bodyDiv) {
this._elmts.form.submit(function(evt){ this._elmts.form.submit(function(evt){
evt.preventDefault(); evt.preventDefault();
if(!isUrlValid(self._elmts.urlInput[0].value)) { var importUrl = self._elmts.urlInput[0].value.trim();
self._elmts.urlInput[0].value = importUrl;
if(!isUrlValid(importUrl)) {
window.alert($.i18n('core-index-import/warning-web-address')); window.alert($.i18n('core-index-import/warning-web-address'));
} else { } else {
self._controller.startImportJob(self._elmts.form, $.i18n('core-index-import/downloading-data')); self._controller.startImportJob(self._elmts.form, $.i18n('core-index-import/downloading-data'));