Skip to content

Commit f9d97a3

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Cache] Use the default expiry when saving (not when creating) items Fix typo Fix DBAL deprecation [Form] Fix ChoiceType translation domain Add Tagalog translations for new form messages [Form] Add missing vietnamese translations sync translations from master [OptionsResolver] Fix force prepend normalizer add vietnamese translation for html5 color validation
2 parents c6cce92 + 319ffd5 commit f9d97a3

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Security/RememberMe/DoctrineTokenProvider.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ public function deleteTokenBySeries(string $series)
8181
$sql = 'DELETE FROM rememberme_token WHERE series=:series';
8282
$paramValues = ['series' => $series];
8383
$paramTypes = ['series' => \PDO::PARAM_STR];
84-
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
84+
if (method_exists($this->conn, 'executeStatement')) {
85+
$this->conn->executeStatement($sql, $paramValues, $paramTypes);
86+
} else {
87+
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
88+
}
8589
}
8690

8791
/**
@@ -101,7 +105,11 @@ public function updateToken(string $series, string $tokenValue, \DateTime $lastU
101105
'lastUsed' => self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE,
102106
'series' => \PDO::PARAM_STR,
103107
];
104-
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
108+
if (method_exists($this->conn, 'executeStatement')) {
109+
$updated = $this->conn->executeStatement($sql, $paramValues, $paramTypes);
110+
} else {
111+
$updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes);
112+
}
105113
if ($updated < 1) {
106114
throw new TokenNotFoundException('No token found.');
107115
}
@@ -129,6 +137,10 @@ public function createNewToken(PersistentTokenInterface $token)
129137
'value' => \PDO::PARAM_STR,
130138
'lastUsed' => self::$useDeprecatedConstants ? Type::DATETIME : Types::DATETIME_MUTABLE,
131139
];
132-
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
140+
if (method_exists($this->conn, 'executeStatement')) {
141+
$this->conn->executeStatement($sql, $paramValues, $paramTypes);
142+
} else {
143+
$this->conn->executeUpdate($sql, $paramValues, $paramTypes);
144+
}
133145
}
134146
}

Tests/Security/RememberMe/DoctrineTokenProviderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private function bootstrapProvider()
7272
'driver' => 'pdo_sqlite',
7373
'url' => 'sqlite:///:memory:',
7474
]);
75-
$connection->executeUpdate(<<< 'SQL'
75+
$connection->{method_exists($connection, 'executeStatement') ? 'executeStatement' : 'executeUpdate'}(<<< 'SQL'
7676
CREATE TABLE rememberme_token (
7777
series char(88) UNIQUE PRIMARY KEY NOT NULL,
7878
value char(88) NOT NULL,

0 commit comments

Comments
 (0)