Skip to content

Commit 0248d4f

Browse files
PF4Publicnicolas-grekas
authored andcommitted
[DoctrineBridge] fix case sensitivity issue in RememberMe\DoctrineTokenProvider
1 parent e4a7fd8 commit 0248d4f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ public function __construct(Connection $conn)
5050
*/
5151
public function loadTokenBySeries($series)
5252
{
53-
$sql = 'SELECT class, username, value, lastUsed'
53+
// the alias for lastUsed works around case insensitivity in PostgreSQL
54+
$sql = 'SELECT class, username, value, lastUsed as last_used'
5455
.' FROM rememberme_token WHERE series=:series';
5556
$paramValues = array('series' => $series);
5657
$paramTypes = array('series' => \PDO::PARAM_STR);
5758
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
5859
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
5960

6061
if ($row) {
61-
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['lastUsed']));
62+
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used']));
6263
}
6364

6465
throw new TokenNotFoundException('No token found.');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy