Skip to content

Commit 119715d

Browse files
jjjb03Johannes Boost
authored andcommitted
fix: DoctrineTokenProvider not oracle compatible
Oracle converts all not quoted names to uppercase
1 parent cc3fb70 commit 119715d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,17 @@ public function __construct(Connection $conn)
5555
*/
5656
public function loadTokenBySeries(string $series)
5757
{
58-
// the alias for lastUsed works around case insensitivity in PostgreSQL
59-
$sql = 'SELECT class, username, value, lastUsed AS last_used FROM rememberme_token WHERE series=:series';
58+
$sql = 'SELECT class, username, value, lastUsed FROM rememberme_token WHERE series=:series';
6059
$paramValues = ['series' => $series];
6160
$paramTypes = ['series' => ParameterType::STRING];
6261
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
63-
$row = $stmt instanceof Result || $stmt instanceof DriverResult ? $stmt->fetchAssociative() : $stmt->fetch(\PDO::FETCH_ASSOC);
62+
63+
// fetching numeric because column name casing depends on platform, eg. Oracle converts all not quoted names to uppercase
64+
$row = $stmt instanceof Result || $stmt instanceof DriverResult ? $stmt->fetchNumeric() : $stmt->fetch(\PDO::FETCH_NUM);
6465

6566
if ($row) {
66-
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used']));
67+
[$class, $username, $value, $last_used] = $row;
68+
return new PersistentToken($class, $username, $series, $value, new \DateTime($last_used));
6769
}
6870

6971
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