Skip to content

Conversation

@BertalanD
Copy link
Member

@BertalanD BertalanD commented Aug 4, 2025

HTML treats input validation patterns as v-mode RegExes, which requires special characters to be escaped in more cases. The previous patterns were syntactically invalid, and thus ignored by browsers:

Pattern attribute value [+][0-9]{1,4}[-\s()0-9]* is not a valid regular
expression:

Uncaught SyntaxError: Invalid regular expression:
/[+][0-9]{1,4}[-\s()0-9]*/v: Invalid character in character class

@BertalanD BertalanD requested a review from horcsinbalint August 4, 2025 08:15
@BertalanD BertalanD requested a review from a team as a code owner August 4, 2025 08:15
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 4, 2025

📝 Walkthrough

Walkthrough

The changes correct the HTML input pattern for phone-number validation in two Blade templates by escaping special characters in the regular expressions. A minor whitespace adjustment was also made in the registration view.

Changes

Cohort / File(s) Change Summary
Phone number pattern fixes
resources/views/auth/register.blade.php, resources/views/user/personal-information.blade.php
Updated the pattern attribute for phone number inputs from "[+][0-9]{1,4}[-\s()0-9]*" to "\+[0-9]{1,4}[\-\s\(\)0-9]*" (escapes added). Minor whitespace formatting change in the registration view.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description addresses the core issue but lacks several required template sections including 'Related Issue', 'Changes', and 'Additional Notes'. Complete the description by adding the missing sections: list specific files and pattern changes under 'Changes', reference any related issue, and note any additional context such as the reviewer's recommendation regarding timing.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix phone number regexes' directly and concisely summarizes the main objective of the pull request—correcting invalid regex patterns in phone number validation fields.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25c2bd4 and c97b56e.

📒 Files selected for processing (2)
  • resources/views/auth/register.blade.php
  • resources/views/user/personal-information.blade.php
🚧 Files skipped from review as they are similar to previous changes (2)
  • resources/views/auth/register.blade.php
  • resources/views/user/personal-information.blade.php

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
resources/views/user/personal-information.blade.php (1)

80-80: Pattern looks sound – consider complementary UX attributes

The corrected regex now conforms to HTML pattern syntax – splendid work. For a slightly more polished user experience you might also add a title, inputmode="tel" or autocomplete="tel" attribute so browsers can display helpful hints and the numeric keypad on mobiles.

 pattern="\+[0-9]{1,4}[\-\s\(\)0-9]*"
+title="+36 (20) 123-4567"
+inputmode="tel"
+autocomplete="tel"

Kindly confirm that the server-side validator accepts the same format, lest client and server drift out of sync.

resources/views/auth/register.blade.php (1)

43-43: Regex correction mirrored correctly; same UX niceties apply

The escaped plus and hyphen resolve the browser warning – good show. As in the personal-information form, consider appending title, inputmode, and autocomplete attributes for consistency and user guidance.

 pattern="\+[0-9]{1,4}[\-\s\(\)0-9]*"
+title="+36 (20) 123-4567"
+inputmode="tel"
+autocomplete="tel"
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 278490a and 25c2bd4.

📒 Files selected for processing (2)
  • resources/views/auth/register.blade.php (2 hunks)
  • resources/views/user/personal-information.blade.php (1 hunks)
🔇 Additional comments (2)
resources/views/user/personal-information.blade.php (1)

23-24: No functional change – nothing further to mention.

resources/views/auth/register.blade.php (1)

23-23: Whitespace-only adjustment – perfectly acceptable.

@horcsinbalint
Copy link
Member

I'd only fix this after this year's application period as it would be quite confusing for applicants if they edit some other personal information and the system just starts randomly asking them to edit their phone number. There is only one phone number that is actually unusable for non-verified users. I would probably go through manually on the users' data - many start with 06 or 07 - and fix it for them after this PR is merged (but I would only do it after the application period).

HTML treats input validation patterns as v-mode RegExes, which requires
special characters to be escaped in more cases. The previous patterns
were syntactically invalid, and thus ignored by browsers:

```
Pattern attribute value [+][0-9]{1,4}[-\s()0-9]* is not a valid regular
expression:

Uncaught SyntaxError: Invalid regular expression:
/[+][0-9]{1,4}[-\s()0-9]*/v: Invalid character in character class
```
@horcsinbalint horcsinbalint merged commit 30fbe06 into development Jan 2, 2026
3 of 5 checks passed
@horcsinbalint horcsinbalint deleted the phone-number-regex branch January 2, 2026 20:56
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.

3 participants