-
Notifications
You must be signed in to change notification settings - Fork 4
Update username validation to support hyphens and underscores #5
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
Conversation
Co-authored-by: rogeriolino <1065082+rogeriolino@users.noreply.github.com>
|
@copilot create a unit test using PHPUnit inside the "tests" folder. This new testcase must extend the |
Co-authored-by: rogeriolino <1065082+rogeriolino@users.noreply.github.com>
I've created a comprehensive PHPUnit test class
The test validates that the updated regex pattern Commit: 9bdfc32 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
rogeriolino
left a comment
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.
build failing due to phpcs (command vendor/bin/phpcs) errors:
FILE: tests/Form/UsuarioTypeTest.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
1[9](https://github.com/novosga/users-bundle/actions/runs/16456559555/job/46560392634?pr=5#step:5:10) | ERROR | [x] Type Symfony\Component\Form\FormInterface is not used in
| | this file.
136 | ERROR | [x] Whitespace found at end of line
202 | ERROR | [x] Whitespace found at end of line
205 | ERROR | [x] Expected 1 newline at end of file; 0 found
Co-authored-by: rogeriolino <1065082+rogeriolino@users.noreply.github.com>
... Fixed all PHPCS errors: removed unused FormInterface import, removed trailing whitespace, and added missing newline at end of file. Commit: e41a4e7 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…ethod calls Co-authored-by: rogeriolino <1065082+rogeriolino@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR updates the username validation in
UsuarioType.phpto allow hyphens (-) and underscores (_) in addition to the currently supported letters, numbers, and periods.Changes Made
Updated the regex pattern from:
To:
Also updated the corresponding JavaScript input filter from:
"this.value = this.value.replace(/([^\w\d\.])+/g, '')"To:
"this.value = this.value.replace(/([^\w\d\.\-_])+/g, '')"Supported Username Patterns
The following username patterns are now supported:
username(letters and numbers)user.name(with periods)user-name(with hyphens) ✨ NEWuser_name(with underscores) ✨ NEWValidation
Both server-side (PHP) and client-side (JavaScript) validation have been updated to maintain consistency. Invalid characters like spaces,
@,#, etc. are still properly rejected.Fixes #4.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/doctrine/collections/zipball/2eb07e5953eed811ce1b309a7478a3b236f2273d/usr/bin/php8.3 -n -c /tmp/pNjXCG /usr/bin/composer install(http block)https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf/usr/bin/php8.3 -n -c /tmp/XwV18c /usr/bin/composer install --no-dev(http block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.