From 964916697a803d7d1b26d24a5c8a55826e4ef05e Mon Sep 17 00:00:00 2001 From: martinbohmcz Date: Tue, 4 Jul 2017 14:44:50 +0200 Subject: [PATCH 1/2] Added support for boolean values and a fallback When the value was boolean type, the script has omitted it, which lead to different counts of items in 'keys' and 'values' arrays, which therefore lead to malfuction. I have also added the last 'else' as a fallback for the case when every other condition fails. --- pdo-debug.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pdo-debug.php b/pdo-debug.php index 8ee7400..7b27e57 100644 --- a/pdo-debug.php +++ b/pdo-debug.php @@ -51,7 +51,11 @@ static public function show($raw_sql, $parameters) $values[] = implode(',', $value); } elseif (is_null($value)) { $values[] = 'NULL'; - } + } elseif (is_bool($value)) { + $values[] = strval($value); + } else { + $values[] = strval($value); + } } if ($isNamedMarkers) { return preg_replace($keys, $values, $raw_sql); From 1d0fa3ba0ef99f45cf1d0292c94b04c15867c781 Mon Sep 17 00:00:00 2001 From: martinbohmcz Date: Tue, 4 Jul 2017 14:49:00 +0200 Subject: [PATCH 2/2] Update pdo-debug.php --- pdo-debug.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pdo-debug.php b/pdo-debug.php index 7b27e57..470ac7d 100644 --- a/pdo-debug.php +++ b/pdo-debug.php @@ -52,10 +52,10 @@ static public function show($raw_sql, $parameters) } elseif (is_null($value)) { $values[] = 'NULL'; } elseif (is_bool($value)) { - $values[] = strval($value); - } else { - $values[] = strval($value); - } + $values[] = strval($value); + } else { + $values[] = strval($value); + } } if ($isNamedMarkers) { return preg_replace($keys, $values, $raw_sql);