From d1276bb20e4265309ea2655c8fd9209b74282f81 Mon Sep 17 00:00:00 2001 From: wubinworks <127310257+wubinworks@users.noreply.github.com> Date: Sat, 11 Jan 2025 21:32:52 +0900 Subject: [PATCH] Fix admin grid filter backslash escaping issue https://github.com/magento/magento2/issues/39513 --- app/code/Magento/Ui/Component/Filters/Type/Input.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Ui/Component/Filters/Type/Input.php b/app/code/Magento/Ui/Component/Filters/Type/Input.php index d9e27fae8201d..0dbc17cbb9e4a 100644 --- a/app/code/Magento/Ui/Component/Filters/Type/Input.php +++ b/app/code/Magento/Ui/Component/Filters/Type/Input.php @@ -74,7 +74,7 @@ protected function applyFilter(): void $valueExpression = $filterConfig['valueExpression'] ?? null; } if ($conditionType === self::CONDITION_LIKE) { - $value = str_replace(['%', '_'], ['\%', '\_'], $value); + $value = str_replace(['\\', '%', '_'], ['\\\\', '\%', '\_'], $value); $valueExpression = $valueExpression ?? '%%%s%%'; } if ($valueExpression) {