DB::insert() and the like should use __toString() value for objects whenever possible
This commit is contained in:
@@ -515,7 +515,7 @@ class MeekroDB {
|
|||||||
if (is_object($value)) {
|
if (is_object($value)) {
|
||||||
if ($value instanceof MeekroDBEval) return $value->text;
|
if ($value instanceof MeekroDBEval) return $value->text;
|
||||||
else if ($value instanceof DateTime) return $this->escape($value->format('Y-m-d H:i:s'));
|
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' : "''";
|
if (is_null($value)) return $this->usenull ? 'NULL' : "''";
|
||||||
|
|||||||
Reference in New Issue
Block a user