Skip to content

Commit 08a34fd

Browse files
Potential fix for code scanning alert no. 474: Inefficient regular expression
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 1b63087 commit 08a34fd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function validateIP (ip) {
9595

9696
// Validate URL
9797
function validateURL (url) {
98-
const regex = /^(https?:\/\/)?[\w.-]+(\.[\w.-]+)+[/#?]?.*$/
98+
const regex = /^(https?:\/\/)?[A-Za-z0-9_.-]+(\.[A-Za-z0-9_.-]+)+[/#?]?.*$/
9999
return regex.test(url)
100100
}
101101

0 commit comments

Comments
 (0)