composer-update-patch

This commit is contained in:
Manish Verma
2016-11-03 05:44:29 +05:30
parent 2dca47f5a4
commit 5d49d384a0
5118 changed files with 51603 additions and 122575 deletions

View File

@@ -100,7 +100,12 @@ class QueryCollector extends PDOCollector
$bindings = $this->checkBindings($bindings);
if (!empty($bindings) && $this->renderSqlWithParams) {
foreach ($bindings as $key => $binding) {
$regex = is_numeric($key) ? '/\?/' : "/:{$key}/";
// This regex matches placeholders only, not the question marks,
// nested in quotes, while we iterate through the bindings
// and substitute placeholders by suitable values.
$regex = is_numeric($key)
? "/\?(?=(?:[^'\\\']*'[^'\\\']*')*[^'\\\']*$)/"
: "/:{$key}(?=(?:[^'\\\']*'[^'\\\']*')*[^'\\\']*$)/";
$query = preg_replace($regex, $pdo->quote($binding), $query, 1);
}
}