From 02443480b3f22752d2e4d11f7dbe642514f1bdfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 20 Feb 2026 10:56:31 +0100 Subject: [PATCH] locale lowercase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../request/applyPredicateEntityFilterToQuery.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/catalog-backend/src/service/request/applyPredicateEntityFilterToQuery.ts b/plugins/catalog-backend/src/service/request/applyPredicateEntityFilterToQuery.ts index d077bd1460..91b29b6ce1 100644 --- a/plugins/catalog-backend/src/service/request/applyPredicateEntityFilterToQuery.ts +++ b/plugins/catalog-backend/src/service/request/applyPredicateEntityFilterToQuery.ts @@ -187,7 +187,7 @@ function applyPredicateInStrategy( return targetQuery[negate ? 'andWhereNot' : 'andWhere']( function fieldFilter() { for (const [key, value] of Object.entries(filter)) { - const normalizedKey = key.toLowerCase(); + const normalizedKey = key.toLocaleLowerCase('en-US'); if (isExistsValue(value)) { // Handle $exists @@ -202,7 +202,9 @@ function applyPredicateInStrategy( } } else if (isInValue(value)) { // Handle $in - const values = value.$in.map(v => String(v).toLowerCase()); + const values = value.$in.map(v => + String(v).toLocaleLowerCase('en-US'), + ); const matchQuery = knex('search') .select('search.entity_id') .where({ key: normalizedKey }) @@ -210,7 +212,7 @@ function applyPredicateInStrategy( this.andWhere(onEntityIdField, 'in', matchQuery); } else if (isHasPrefixValue(value)) { // Handle $hasPrefix - const prefix = value.$hasPrefix.toLowerCase(); + const prefix = value.$hasPrefix.toLocaleLowerCase('en-US'); const escaped = prefix.replace(/[%_\\]/g, c => `\\${c}`); const matchQuery = knex('search') .select('search.entity_id') @@ -227,7 +229,7 @@ function applyPredicateInStrategy( .select('search.entity_id') .where({ key: normalizedKey, - value: String(value).toLowerCase(), + value: String(value).toLocaleLowerCase('en-US'), }); this.andWhere(onEntityIdField, 'in', matchQuery); } else {