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(isMobilePhone): Fix en-BM matching invalid numbers due to missing end-of-string anchor #2116

Merged
merged 2 commits into from Jan 29, 2023

Conversation

pano9000
Copy link
Contributor

@pano9000 pano9000 commented Dec 6, 2022

Please see #2115
Fix this by adding the missing end-of-string anchor to the RegExp.

quick side note:
the regExp can be even simplified a bit more to the following version ^(\+?1)?441(((3|7)\d{6})|(5[0-39]\d{5}))$, which still passes all tests, but is shorter, however since this is more a quick bug fix, I did not include this in my commit, but sticked to using the existing format.

Fixes #2115

Checklist

  • PR contains only changes related; no stray files, etc.
  • [ ] README updated (where applicable)
  • Tests written (where applicable)

@codecov
Copy link

codecov bot commented Dec 6, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (b2249b6) compared to base (f97e8d4).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2116   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          105       105           
  Lines         2335      2335           
  Branches       586       586           
=========================================
  Hits          2335      2335           
Impacted Files Coverage Δ
src/lib/isMobilePhone.js 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

braaar
braaar previously approved these changes Dec 7, 2022
WikiRik
WikiRik previously approved these changes Dec 13, 2022
rubiin
rubiin previously approved these changes Jan 21, 2023
@profnandaa profnandaa added the mc-to-land Just merge-conflict standing between the PR and landing. label Jan 28, 2023
that one particular number combination was missing the `$` end-of-string anchor, which caused the bug validatorjs#2115

fixes validatorjs#2115
@rubiin rubiin removed the mc-to-land Just merge-conflict standing between the PR and landing. label Jan 29, 2023
@profnandaa profnandaa merged commit c81df18 into validatorjs:master Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isMobilePhone: en-BM matches invalid numbers
5 participants