DB::insert() and the like should use __toString() value for objects whenever possible

This commit is contained in:
Sergey Tsalkov
2014-11-27 01:30:42 +00:00
parent 076a7e2b9b
commit da46a1eacc

View File

@@ -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' : "''";