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 a7d0d82

Browse filesBrowse files
committed
Fix RememberMe with null password
1 parent b4a63f9 commit a7d0d82
Copy full SHA for a7d0d82

File tree

1 file changed

+6
-6
lines changed
Filter options

1 file changed

+6
-6
lines changed

‎src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ protected function onLoginSuccess(Request $request, Response $response, TokenInt
9191
/**
9292
* Generates the cookie value.
9393
*
94-
* @param int $expires The Unix timestamp when the cookie expires
95-
* @param string $password The encoded password
94+
* @param int $expires The Unix timestamp when the cookie expires
95+
* @param string|null $password The encoded password
9696
*
9797
* @return string
9898
*/
99-
protected function generateCookieValue(string $class, string $username, int $expires, string $password)
99+
protected function generateCookieValue(string $class, string $username, int $expires, ?string $password)
100100
{
101101
// $username is encoded because it might contain COOKIE_DELIMITER,
102102
// we assume other values don't
@@ -111,12 +111,12 @@ protected function generateCookieValue(string $class, string $username, int $exp
111111
/**
112112
* Generates a hash for the cookie to ensure it is not being tampered with.
113113
*
114-
* @param int $expires The Unix timestamp when the cookie expires
115-
* @param string $password The encoded password
114+
* @param int $expires The Unix timestamp when the cookie expires
115+
* @param string|null $password The encoded password
116116
*
117117
* @return string
118118
*/
119-
protected function generateCookieHash(string $class, string $username, int $expires, string $password)
119+
protected function generateCookieHash(string $class, string $username, int $expires, ?string $password)
120120
{
121121
return hash_hmac('sha256', $class.self::COOKIE_DELIMITER.$username.self::COOKIE_DELIMITER.$expires.self::COOKIE_DELIMITER.$password, $this->getSecret());
122122
}

0 commit comments

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