-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix: isURL incorrectly accepts email-like strings (#1674) #2557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -469,6 +469,21 @@ | |
], | ||
}); | ||
}); | ||
|
||
Check failure on line 472 in test/validators.test.js
|
||
it('should not validate email-like strings as URLs', () => { | ||
test({ | ||
validator: 'isURL', | ||
valid: [], | ||
invalid: [ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
], | ||
}); | ||
}); | ||
|
||
it('should validate URLs with custom protocols', () => { | ||
test({ | ||
|
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High