Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0fdfcae

Browse filesBrowse files
authored
[RateLimiter] Adding default empty value
Because Security::LAST_USERNAME not always exist, it can trigger a "preg_match(): Argument #2 ($subject) must be of type string" if $username is null
1 parent c9a5155 commit 0fdfcae
Copy full SHA for 0fdfcae

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/Security/Http/RateLimiter/DefaultLoginRateLimiter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/RateLimiter/DefaultLoginRateLimiter.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(RateLimiterFactory $globalFactory, RateLimiterFactor
3737

3838
protected function getLimiters(Request $request): array
3939
{
40-
$username = $request->attributes->get(Security::LAST_USERNAME);
40+
$username = $request->attributes->get(Security::LAST_USERNAME, '');
4141
$username = preg_match('//u', $username) ? mb_strtolower($username, 'UTF-8') : strtolower($username);
4242

4343
return [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.