From 2af7985effdec0e823f1f34fac335bf144e595bc Mon Sep 17 00:00:00 2001 From: Marcel Zweifel Date: Mon, 17 Feb 2025 08:47:17 +0100 Subject: [PATCH] Remove deprecation message str_replace --- UPGRADE.md | 5 ++++- src/OutputChannel/Modifier/Filter/QueryCleanTermFilter.php | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 6591997..f7c6473 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,7 +1,10 @@ # Upgrade Notes +## 3.0.2 +[BUGFIX] QueryCleanTermFilter str_replace fallback + ## 3.0.1 -- [LICENSE] Dual-License with GPL and Dachcom Commercial License (DCL) added +[LICENSE] Dual-License with GPL and Dachcom Commercial License (DCL) added ## Migrating from Version 2.x to Version 3.0.0 diff --git a/src/OutputChannel/Modifier/Filter/QueryCleanTermFilter.php b/src/OutputChannel/Modifier/Filter/QueryCleanTermFilter.php index 0219b4d..e3aef12 100644 --- a/src/OutputChannel/Modifier/Filter/QueryCleanTermFilter.php +++ b/src/OutputChannel/Modifier/Filter/QueryCleanTermFilter.php @@ -20,6 +20,8 @@ class QueryCleanTermFilter implements OutputChannelModifierFilterInterface { public function dispatchFilter(OutputChannelAllocatorInterface $outputChannelAllocator, array $options): string { + $rawTerm = $options['raw_term'] ?? ''; + return trim( preg_replace( '|\s{2,}|', @@ -29,7 +31,7 @@ public function dispatchFilter(OutputChannelAllocatorInterface $outputChannelAll ' ', strtolower( strip_tags( - str_replace("\n", ' ', $options['raw_term']) + str_replace("\n", ' ', $rawTerm) ) ) )