Skip to content
Snippets Groups Projects
Commit 4e9d1f7d authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #342366 by John Morahan, Dave Reid, Damien Tournoud: fixed replacement...

- Patch #342366 by John Morahan, Dave Reid, Damien Tournoud: fixed replacement of unnamed placeholders in SQLite.
parent 5a53f843
No related branches found
No related tags found
No related merge requests found
......@@ -198,7 +198,10 @@ protected function getStatement($query, &$args = array()) {
// Else, this is using named placeholders.
foreach ($args as $placeholder => $value) {
if (is_numeric($value)) {
$query = str_replace($placeholder, $value, $query);
// When replacing the placeholders, make sure we search for the
// exact placeholder. For example, if searching for
// ':db_placeholder_1', do not replace ':db_placeholder_11'.
$query = preg_replace('/' . preg_quote($placeholder) . '\b/', $value, $query);
unset($args[$placeholder]);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment