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

fix: IsPhoneNumber decorator did not validate correctly #1454

Closed
wants to merge 1 commit into from

Conversation

florinTAPP
Copy link

Description

Strings with characters before or after a correct phone number were being passed as valid.

Checklist

  • the pull request title describes what this PR does (not a vague title like Update index.md)
  • the pull request targets the default branch of the repository (develop)
  • the code follows the established code style of the repository
    • npm run prettier:check passes
    • npm run lint:check passes
  • tests are added for the changes I made (if any source code was modified)
  • documentation added or updated
  • I have run the project locally and verified that there are no errors

@florinTAPP florinTAPP changed the title -IsPhoneNumber decorator did not validate correctly IsPhoneNumber decorator did not validate correctly Dec 16, 2021
@florinTAPP florinTAPP changed the title IsPhoneNumber decorator did not validate correctly fix: IsPhoneNumber decorator did not validate correctly Dec 16, 2021
@braaar
Copy link
Member

braaar commented Oct 3, 2022

@florinTAPP - could you add some test cases to demonstrate this fix?

@frzimmer
Copy link

We have a very similar problem.
The validation for numbers with a character (e.g. "+", "abc", ...) at the beginning works correctly, because these cases are not considered valid.
But characters after a valid phone number still pass as valid.
I created a sandbox example to demonstrate this behavior: https://codesandbox.io/s/intelligent-vaughan-lc9z3r?file=/src/App.js
Is there still a plan to do something about this?

@NoNameProvided
Copy link
Member

Superset by #1857. That PR should fix your problem.

@NoNameProvided NoNameProvided added the status: superset by another Issue or task being tracked/handled in a different issue. label Dec 15, 2022
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: superset by another Issue or task being tracked/handled in a different issue.
Development

Successfully merging this pull request may close these issues.

4 participants