From 630c7dcd684f61e4fc31a12649dbd8dd601f0f59 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 27 Oct 2016 14:16:52 +0100 Subject: [PATCH] field.quote for boolean, function string --- lib/php/db/field.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/php/db/field.php b/lib/php/db/field.php index 19ea29db..965c9ffd 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -168,6 +168,10 @@ class field extends nb { if ($value === null) return 'NULL'; if ($force_quote or $this->string()) { + if ($value === '') { + if (strpos($this->type,'time') !== false) return 'NULL'; + if (strpos($this->type,'date') !== false) return 'NULL'; + } if (!($db = $this->db())) return "'".preg_replace("/'/","\\'",$value)."'"; return $db->quote($value); -- 2.47.3