From da46a1eacc683b34fcbba069c1f25f6930fbb9c9 Mon Sep 17 00:00:00 2001 From: Sergey Tsalkov Date: Thu, 27 Nov 2014 01:30:42 +0000 Subject: [PATCH] DB::insert() and the like should use __toString() value for objects whenever possible --- db.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.class.php b/db.class.php index c7de74e..af91ae1 100644 --- a/db.class.php +++ b/db.class.php @@ -515,7 +515,7 @@ class MeekroDB { if (is_object($value)) { if ($value instanceof MeekroDBEval) return $value->text; else if ($value instanceof DateTime) return $this->escape($value->format('Y-m-d H:i:s')); - else return ''; + else return $this->escape($value); // use __toString() value for objects, when possible } if (is_null($value)) return $this->usenull ? 'NULL' : "''";