-
Notifications
You must be signed in to change notification settings - Fork 100
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
2FA: Add pattern to validate phone number format as per E.164 #5538
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5538 +/- ##
=============================================
+ Coverage 29.40% 29.42% +0.01%
Complexity 4759 4759
=============================================
Files 282 282
Lines 20580 20569 -11
=============================================
Hits 6052 6052
+ Misses 14528 14517 -11 ☔ View full report in Codecov by Sentry. |
Addressing the SonarCloud check that failed, although target="_blank" should handle it
…ic/vip-go-mu-plugins into add/2fa-phone-number-validation
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thank you for handling this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I just tested this and it's still accepting phone numbers such as 780-123-4567. I think it might be missing the <form>
tags around it for the validation?
This pull request has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep pull requests manageable and actionable and is not a comment on the quality of this pull request nor on the work done so far. Closed PRs are still valuable to the project and their branches are preserved. |
@@ -201,12 +201,15 @@ public function user_options( $user ) { | |||
<?php else : ?> | |||
<label>Phone Number | |||
<input name="vip-two-factor-phone" type="tel" | |||
pattern="^\+[1-9]\d{1,14}$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ITU-T specifies that a phone number cannot be longer than fifteen digits, with one to three digits reserved for the country calling code, but valid numbers in Germany have been assigned that are longer than this.
-- https://github.com/google/libphonenumber/blob/master/FALSEHOODS.md
This pull request has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed. This is an automation to keep pull requests manageable and actionable and is not a comment on the quality of this pull request nor on the work done so far. Closed PRs are still valuable to the project and their branches are preserved. |
Description
The SMS provider that the two-factor authentication plugin uses rejects any phone number that isn't in E.164 standards.
Here we're applying some client-side validation using HTML to ensure that incorrect phone numbers aren't configured.
Changelog Description
Changed
Pre-review checklist
Pre-deploy checklist
Steps to Test
wp-admin
>Tools
>Bakery