Skip to content
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

isURL - email addresses validate as URLs #707 #901

Merged
merged 3 commits into from
Oct 11, 2018

Conversation

CodingNagger
Copy link
Contributor

@CodingNagger CodingNagger commented Oct 2, 2018

Adding an option to isURL to allow rejecting URLs containing authentication info.

Fixes #707

Copy link
Collaborator

@chriso chriso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update the README?

lib/isURL.js Outdated
@@ -103,6 +103,9 @@ function isURL(url, options) {

split = url.split('@');
if (split.length > 1) {
if (options.exclude_auth_url) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change this to disallow_auth for consistency with the other options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes can do.

@chriso chriso added the 🧹 needs-update For PRs that need to be updated before landing label Oct 2, 2018
@chriso chriso removed the 🧹 needs-update For PRs that need to be updated before landing label Oct 3, 2018
@chriso chriso merged commit 8c4a74c into validatorjs:master Oct 11, 2018
@torressam333
Copy link

I am still having this issue even with the latest version: 13.7.0

For example:

const validator = require('validator');

console.log(validator.isEmail('john@gmail.com')); //true

console.log(validator.isURL('john@gmail.com')); //true

Both evaluate to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isURL - email addresses validate as URLs
3 participants