]> git.nbdom.net Git - nb.git/commitdiff
field.quote for boolean, function string
authorNicolas Boisselier <nicolas.boisselier@semantico.com>
Thu, 27 Oct 2016 13:16:52 +0000 (14:16 +0100)
committerNicolas Boisselier <nicolas.boisselier@semantico.com>
Thu, 27 Oct 2016 13:16:52 +0000 (14:16 +0100)
lib/php/db/field.php

index 19ea29db075ec1f7f1c72bf40f9b147d1de91a1c..965c9ffd24e2023aeaeae9ef0e6f9ff60b3d7a84 100644 (file)
@@ -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);