Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Model/Traits/Query/CaseSensitiveCompareValueTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getCaseSensitiveValue(SelectQuery $query, mixed $col): QueryExpr
return $col;
}

$valuePlaceholder = ':value_case_insensitive_' . rand();
$valuePlaceholder = ':value_case_insensitive_' . bin2hex(random_bytes(4));
$query = $query->bind($valuePlaceholder, $col, $this->getBindType($col));

return $query->newExpr()->add("CONVERT({$valuePlaceholder} using utf8mb4) COLLATE utf8mb4_bin");
Expand All @@ -65,7 +65,7 @@ public function getCaseSensitiveValues(SelectQuery $query, array $values): array
$conditions = [];
$values = array_unique($values);
foreach ($values as $value) {
$valuePlaceholder = ':value_case_insensitive_' . rand();
$valuePlaceholder = ':value_case_insensitive_' . bin2hex(random_bytes(4));
$conditions[] = $query
->newExpr()
->add("CONVERT({$valuePlaceholder} using utf8mb4) COLLATE utf8mb4_bin");
Expand Down