Skip to content

Commit

Permalink
bug #27314 [DoctrineBridge] fix case sensitivity issue in RememberMe\…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
fabpot committed Nov 26, 2018
2 parents c0bfdeb + 0248d4f commit 8f2ad36
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -50,15 +50,16 @@ public function __construct(Connection $conn)
*/
public function loadTokenBySeries($series)
{
$sql = 'SELECT class, username, value, lastUsed'
// the alias for lastUsed works around case insensitivity in PostgreSQL
$sql = 'SELECT class, username, value, lastUsed as last_used'
.' FROM rememberme_token WHERE series=:series';
$paramValues = array('series' => $series);
$paramTypes = array('series' => \PDO::PARAM_STR);
$stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes);
$row = $stmt->fetch(\PDO::FETCH_ASSOC);

if ($row) {
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['lastUsed']));
return new PersistentToken($row['class'], $row['username'], $series, $row['value'], new \DateTime($row['last_used']));
}

throw new TokenNotFoundException('No token found.');
Expand Down

0 comments on commit 8f2ad36

Please sign in to comment.