mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2026-05-28 04:35:53 -04:00
DbObject: Add pg escape for checksum
This commit is contained in:
parent
06935c442d
commit
2dcd1c2d78
1 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue