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
-------
0248d4f566
[DoctrineBridge] fix case sensitivity issue in RememberMe\DoctrineTokenProvider
This commit is contained in:
commit
8f2ad36ff4
@ -50,7 +50,8 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
|||||||
*/
|
*/
|
||||||
public function loadTokenBySeries($series)
|
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';
|
.' FROM rememberme_token WHERE series=:series';
|
||||||
$paramValues = array('series' => $series);
|
$paramValues = array('series' => $series);
|
||||||
$paramTypes = array('series' => \PDO::PARAM_STR);
|
$paramTypes = array('series' => \PDO::PARAM_STR);
|
||||||
@ -58,7 +59,7 @@ class DoctrineTokenProvider implements TokenProviderInterface
|
|||||||
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if ($row) {
|
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.');
|
throw new TokenNotFoundException('No token found.');
|
||||||
|
Reference in New Issue
Block a user