simplify url regex

This commit is contained in:
snogcel 2016-09-25 08:27:43 -06:00
parent 9f2deea047
commit 119b8f9dfc

View file

@ -3522,7 +3522,7 @@ GovObject.prototype._verifyAddress = function(address, network) {
};
GovObject.prototype._verifyUrl = function(url) {
var urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/;
var urlregex = /^(http|https):\/\/[^ "]+$/;
return urlregex.test(url);
};