Skip to content

Commit

Permalink
Fix query properly
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIII committed Nov 16, 2023
1 parent 8c4358c commit 213f6a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Blacklight/Regexes.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ protected function _fetchRegex(string $groupName): void
{
// Get all regex from DB which match the current group name. Cache them for 15 minutes. #CACHEDQUERY#
$sql = sprintf(
'SELECT r.id, r.regex %s FROM %s r WHERE %s REGEXP r.group_regex AND r.status = 1 ORDER BY r.ordinal ASC, r.group_regex ASC',
'SELECT r.id, r.regex %s FROM %s r WHERE \'%s\' REGEXP r.group_regex AND r.status = 1 ORDER BY r.ordinal ASC, r.group_regex ASC',
($this->tableName === 'category_regexes' ? ', r.categories_id' : ''),
escapeString($this->tableName),
$this->tableName,
$groupName
);

Expand Down

0 comments on commit 213f6a9

Please sign in to comment.