mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-24 00:36:59 +01:00
Fix handling of table prefix and quoting in insert_or_update()
In all places we use this function the $table argument has already been passed through table_name() method, i.e. it contains the prefix and is quoted. So, we should not do this again.
This commit is contained in:
@@ -195,7 +195,7 @@ class rcube_db_pgsql extends rcube_db
|
||||
* INSERT ... ON CONFLICT DO UPDATE.
|
||||
* When not supported by the engine we do UPDATE and INSERT.
|
||||
*
|
||||
* @param string $table Table name
|
||||
* @param string $table Table name (should be already passed via table_name() with quoting)
|
||||
* @param array $keys Hash array (column => value) of the unique constraint
|
||||
* @param array $columns List of columns to update
|
||||
* @param array $values List of values to update (number of elements
|
||||
@@ -211,7 +211,6 @@ class rcube_db_pgsql extends rcube_db
|
||||
return parent::insert_or_update($table, $keys, $columns, $values);
|
||||
}
|
||||
|
||||
$table = $this->table_name($table, true);
|
||||
$columns = array_map([$this, 'quote_identifier'], $columns);
|
||||
$target = implode(', ', array_map([$this, 'quote_identifier'], array_keys($keys)));
|
||||
$cols = $target . ', ' . implode(', ', $columns);
|
||||
|
||||
Reference in New Issue
Block a user