From 32a0aad7204837fd51d28f43cbb4477afe77449a Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 23 Jan 2019 13:50:32 +1300 Subject: [PATCH] =?UTF-8?q?FIX:=20Boolean=20=E2=80=99t=E2=80=99/=E2=80=98f?= =?UTF-8?q?=E2=80=99=20strings=20need=20to=20be=20coerced=20to=20int=20pro?= =?UTF-8?q?perly.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/PostgreSQLQuery.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/PostgreSQLQuery.php b/code/PostgreSQLQuery.php index d372d3c..9d658b0 100644 --- a/code/PostgreSQLQuery.php +++ b/code/PostgreSQLQuery.php @@ -80,7 +80,11 @@ class PostgreSQLQuery extends Query $record[$k] = $v; $type = pg_field_type($this->handle, $i); if (isset(self::$typeMapping[$type])) { - settype($record[$k], self::$typeMapping[$type]); + if ($type === 'bool' && $record[$k] === 't') { + $record[$k] = 1; + } else { + settype($record[$k], self::$typeMapping[$type]); + } } }