Skip to content

Commit

Permalink
migrate/search-url: Prevent further false-positives
Browse files Browse the repository at this point in the history
See included comment

fixes #969
  • Loading branch information
nilmerg committed Mar 14, 2024
1 parent ecb5126 commit 706cd88
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion application/controllers/MigrateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 706cd88

Please sign in to comment.