Skip to content

Commit cb9bd2d

Browse files
Merge branch '5.0'
* 5.0: (38 commits) [Security] Check UserInterface::getPassword is not null before calling needsRehash gracefully handle missing event dispatchers Fix TokenStorage::reset not called in stateless firewall [DotEnv] Remove `usePutEnv` property default value [HttpFoundation] get currently session.gc_maxlifetime if ttl doesnt exists Set up typo fix [DependencyInjection] Handle env var placeholders in CheckTypeDeclarationsPass [Cache] fix memory leak when using PhpArrayAdapter [Validator] Allow underscore character "_" in URL username and password [TwigBridge] Update bootstrap_4_layout.html.twig [DoctrineBridge] Removed QueryBuilder type hint in getLoader() [FrameworkBundle][SodiumVault] Create secrets directory only when needed fix parsing negative octal numbers [String] implement __sleep()/__wakeup() on strings Fixed translations file dumper behavior [Routing][ObjectLoader] Remove forgotten deprecation after merge [SecurityBundle] Passwords are not encoded when algorithm set to \"true\" [DependencyInjection] Resolve expressions in CheckTypeDeclarationsPass [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass do not validate passwords when the hash is null ...
2 parents 8f3db45 + b816858 commit cb9bd2d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Constraints/UrlValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class UrlValidator extends ConstraintValidator
2323
{
2424
const PATTERN = '~^
2525
(%s):// # protocol
26-
(([\.\pL\pN-]+:)?([\.\pL\pN-]+)@)? # basic auth
26+
(([\_\.\pL\pN-]+:)?([\_\.\pL\pN-]+)@)? # basic auth
2727
(
2828
([\pL\pN\pS\-\_\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name
2929
| # or

Tests/Constraints/UrlValidatorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,11 @@ public function getValidUrls()
148148
['http://☎.com/'],
149149
['http://username:[email protected]'],
150150
['http://user.name:[email protected]'],
151+
['http://user_name:[email protected]'],
151152
['http://username:[email protected]'],
152153
['http://user.name:[email protected]'],
153154
['http://[email protected]'],
155+
['http://[email protected]'],
154156
['http://symfony.com?'],
155157
['http://symfony.com?query=1'],
156158
['http://symfony.com/?query=1'],

0 commit comments

Comments
 (0)