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

Several spaces are considered valid Mobile Phone #921

Closed
netkin-paris opened this issue Oct 31, 2018 · 2 comments
Closed

Several spaces are considered valid Mobile Phone #921

netkin-paris opened this issue Oct 31, 2018 · 2 comments

Comments

@netkin-paris
Copy link

Hello,
When passing one space to isMobilePhone, the result is false, which is ok.
When passing several spaces, the result is true, which is probably a bug.
See screenshot attached :)

image

@ezkemboi
Copy link
Member

In the current version 11.0.1, I do not see the error where spaces is a valid mobile phone number.
For instance:

      var validator = require("validator");
      var isValid = validator.isMobilePhone('            ');
      // The above situation returns false

The only thing that I can extend this conversation is, will we allow valid number with whitespaces to be valid? For example

      var validator = require("validator");
      var isValid = validator.isMobilePhone('      0702346787      ');
      // This returns false due to whitespaces. But, inside is a valid mobilephone

@netkin-paris, @profnandaa and @chriso, you can check on above. Thank you.

@pano9000
Copy link
Contributor

Closing the issue, as this has been adressed by PR #933 already and I cannot reproduce this error in current master or in version 13.7.0.

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

No branches or pull requests

4 participants