Skip to content

Commit

Permalink
Fixes Smile-SA#1793 use RegExp object instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
androshchuk committed May 4, 2020
1 parent c5bbc5e commit 4dd5bee
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -18,7 +18,7 @@
* @return boolean
*/
function isUrl(string) {
var urlRegexp = /^(https?:\/\/|ftps?:\/\/)?([a-z0-9%-]+\.){1,}([a-z0-9-]+)?(:(\d{1,5}))?(\/([a-z0-9\-._~:/?#[\]@!$&'()*+,;=%]+)?)?$/i;
var urlRegexp = new RegExp("^(https?:\\/\\/|ftps?:\\/\\/)?([a-z0-9%-]+\\.){1,}([a-z0-9-]+)?(:(\\d{1,5}))?(\\/([a-z0-9\\-._~:/?#[\\]@!$&'()*+,;=%]+)?)?$", "i");
return urlRegexp.test(string);
}

Expand Down

0 comments on commit 4dd5bee

Please sign in to comment.