From 706cd88791872af35baf00d93d7ae455e526c3a4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 2 Feb 2024 15:36:42 +0100 Subject: [PATCH] migrate/search-url: Prevent further false-positives See included comment fixes #969 --- application/controllers/MigrateController.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/application/controllers/MigrateController.php b/application/controllers/MigrateController.php index 811b5d059..c14eef7e6 100644 --- a/application/controllers/MigrateController.php +++ b/application/controllers/MigrateController.php @@ -90,8 +90,16 @@ public function searchUrlAction() $params = $url->onlyWith(['sort', 'limit', 'view', 'columns', 'page'])->getParams(); $filter = $url->without(['sort', 'limit', 'view', 'columns', 'page'])->getParams(); $filter = QueryString::parse((string) $filter); + $nonStrictOriginalFilter = QueryString::render($filter); $filter = UrlMigrator::transformLegacyWildcardFilter($filter); - $result[] = rawurldecode($url->setParams($params)->setFilter($filter)->getAbsoluteUrl()); + $nonStrictUpdatedFilter = QueryString::render($filter); + if ($nonStrictUpdatedFilter !== $nonStrictOriginalFilter) { + // The original filter might be formatted loosely, so if we render it again, + // it might look different although nothing changed + $result[] = rawurldecode($url->setParams($params)->setFilter($filter)->getAbsoluteUrl()); + } else { + $result[] = $urlString; + } } $response = $this->getResponse()->json();