use less restrictive URL validation

pull/1/head
ansuz 4 years ago
parent abc9466abe
commit d610f6ef1e

@ -1596,7 +1596,7 @@ define([
var getData = function () { var getData = function () {
var url = $input.val(); var url = $input.val();
if (!Util.isValidURL(url)) { if (!Util.isValidURL(url)) {
console.error('Invalid URL'); console.error('Invalid URL', url);
return false; return false;
} }
return url; return url;

@ -559,8 +559,8 @@
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name
'((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address '((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path
'(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string '(\\?[;&a-z\\d%_.~+=-]*)?'); // query string
'(\\#[-a-z\\d_]*)?$','i'); // fragment locator //'(\\#[-a-z\\d_]*)?$','i'); // fragment locator
return !!pattern.test(str); return !!pattern.test(str);
}; };

Loading…
Cancel
Save