Skip to content

Commit 8f2ad36

Browse files
committed
bug #27314 [DoctrineBridge] fix case sensitivity issue in RememberMe\DoctrineTokenProvider (PF4Public)
This PR was merged into the 2.8 branch. Discussion ---------- [DoctrineBridge] fix case sensitivity issue in RememberMe\DoctrineTokenProvider | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | ? | Fixed tickets | #21467 | License | MIT | Doc PR | - Commits ------- 0248d4f [DoctrineBridge] fix case sensitivity issue in RememberMe\DoctrineTokenProvider
2 parents c0bfdeb + 0248d4f commit 8f2ad36

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