Skip to content

Commit bafb390

Browse files
authored
Force value as string Fixes #1284
1 parent c90b0f7 commit bafb390

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DataCollector/QueryCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function addQuery($query, $bindings, $time, $connection)
160160
if (!is_int($binding) && !is_float($binding)) {
161161
if ($pdo) {
162162
try {
163-
$binding = $pdo->quote($binding);
163+
$binding = $pdo->quote((string) $binding);
164164
} catch (\Exception $e) {
165165
$binding = $this->emulateQuote($binding);
166166
}
@@ -211,7 +211,7 @@ protected function emulateQuote($value)
211211
$search = ["\\", "\x00", "\n", "\r", "'", '"', "\x1a"];
212212
$replace = ["\\\\","\\0","\\n", "\\r", "\'", '\"', "\\Z"];
213213

214-
return "'" . str_replace($search, $replace, $value) . "'";
214+
return "'" . str_replace($search, $replace, (string) $value) . "'";
215215
}
216216

217217
/**

0 commit comments

Comments
 (0)