diff --git a/Services/Database/classes/PDO/class.ilDBPdo.php b/Services/Database/classes/PDO/class.ilDBPdo.php index 484a30cc5e6b..0c2ef6785118 100644 --- a/Services/Database/classes/PDO/class.ilDBPdo.php +++ b/Services/Database/classes/PDO/class.ilDBPdo.php @@ -1,5 +1,19 @@ quoteIdentifier($table_name) . " SET "; $lim = ""; foreach ($fields as $k => $field) { - $q .= $lim . $field . " = " . $placeholders_full[$k]; + $q .= $lim . $this->quoteIdentifier($field) . " = " . $placeholders_full[$k]; $lim = ", "; } $q .= " WHERE "; $lim = ""; foreach ($where as $k => $col) { - $q .= $lim . $k . " = " . $this->quote($col[1], $col[0]); + $q .= $lim . $this->quoteIdentifier($k) . " = " . $this->quote($col[1], $col[0]); $lim = " AND "; } @@ -715,7 +729,7 @@ public function update($table_name, $columns, $where) $q .= " WHERE "; $lim = ""; foreach ($where as $k => $col) { - $q .= $lim . $k . " = %s"; + $q .= $lim . $this->quoteIdentifier($k) . " = %s"; $lim = " AND "; } @@ -1144,7 +1158,7 @@ public function replace($table, $primaryKeys, $otherColumns) $values = array(); foreach ($a_columns as $k => $col) { - $fields[] = $k; + $fields[] = $this->quoteIdentifier($k); $placeholders[] = "%s"; $placeholders2[] = ":$k"; $types[] = $col[0];