Skip to content
Permalink
Browse files

QueryLogger interpolate

While interpolating the placeholders gets wrongly replaced.

When :c1 gets replaced by his param, every placeholder from :c10 to
:c19 gets replaced with the wrong param too + last number from original
placeholder.

an array_reverse() will prevent this behavior
  • Loading branch information...
Baffos committed May 8, 2015
1 parent 22976db commit d4f8078b590eb0877befbf111584be1ea3e6dce1
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/Database/Log/QueryLogger.php
@@ -71,6 +71,7 @@ protected function _interpolate($query)
$keys = [];
$limit = is_int(key($params)) ? 1 : -1;
$params = array_reverse($params);
foreach ($params as $key => $param) {
$keys[] = is_string($key) ? "/:$key/" : '/[?]/';
}

0 comments on commit d4f8078

Please sign in to comment.
You can’t perform that action at this time.