DbObject: Add pg escape for checksum

This commit is contained in:
Alexander Fuhr 2015-06-23 14:19:30 +02:00
parent 06935c442d
commit 2dcd1c2d78
1 changed files with 8 additions and 0 deletions

View File

@ -554,6 +554,14 @@ abstract class DbObject
if ($this->autoincKeyName !== null) {
unset($properties[$this->autoincKeyName]);
}
if ($this->connection->getDbType() === 'pgsql') {
foreach ($properties as $key => $value) {
if (preg_match('/checksum$/', $key)) {
$properties[$key] = new \Zend_Db_Expr("'" . pg_escape_bytea($value) . "'");
}
}
}
return $this->db->insert($this->table, $properties);
}