Skip to content

Commit

Permalink
Fix issue where ? can leak in via conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ilijastuden committed Oct 9, 2023
1 parent 8890641 commit 4b10203
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ private function prepareUniquenessValidatorSql(array $field_names, mixed $where)

return $this->connection->prepare(
sprintf(
"SELECT COUNT(`id`) AS 'row_count' FROM %s WHERE (%s) AND (`id` != ?)",
"SELECT COUNT(`id`) AS 'row_count' FROM %s WHERE `id` != ? AND (%s)",
$this->connection->escapeTableName($this->table_name),
implode(' AND ', $conditions)
),
Expand Down

0 comments on commit 4b10203

Please sign in to comment.