diff --git a/index.js b/index.js index 329c99b..25c0679 100644 --- a/index.js +++ b/index.js @@ -88,7 +88,7 @@ function showPosition(position) { // } let valid = true; // const domainExp = new RegExp("^http(s)*:\\/\\/[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]+)+[_#]*$"); - const domainExp = new RegExp("^http(s)*:\\/\\/[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]+)+[\\/_#a-zA-Z0-9\\-]*$"); + const domainExp = new RegExp("^http(s)*:\\/\\/[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]+)+[\\/_#a-zA-Z0-9=?\\-]*$"); const filepathExp = new RegExp("^[a-zA-Z]+$"); const glinkExp = new RegExp("^[a-zA-Z]*$"); let glinkStr = glink.value; diff --git a/result.php b/result.php index 778e621..aac1c57 100644 --- a/result.php +++ b/result.php @@ -25,7 +25,7 @@ if ($is_geo == 1) { $longitude = doubleval($longitude); } -$matches = preg_match('/^http(s)*:\\/\\/[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]+)+[\\/_#a-zA-Z0-9\\-]*$/',$url); +$matches = preg_match('/^http(s)*:\\/\\/[a-zA-Z0-9\\-]+(\\.[a-zA-Z0-9\\-]+)+[\\/_#a-zA-Z0-9=?\\-]*$/',$url); if (($matches == 0) || ($matches == false)) { printf("The URL entered was invalid. Please try again."); return;