Skip to content
Snippets Groups Projects
Commit 713546d1 authored by Igor Biki's avatar Igor Biki
Browse files

ISTWCMS-7266: Handle fragments and query strings in canonical path generation

Previously, fragment or query string components were not appended to canonical paths. This update ensures these components are retained by detecting and appending them to the generated path. It improves the accuracy and completeness of internal path handling.
parent 6d4b7a2e
No related branches found
No related tags found
1 merge request!265ISTWCMS-7266: Refactor link handling logic in UwCblLinks block.
This commit is part of merge request !265. Comments created here will be created in the context of that merge request.
......@@ -969,6 +969,13 @@ class UwCblLinks extends BlockBase implements ContainerFactoryPluginInterface {
}
else {
$canonical = $path->getInternalPath();
// Detects if there is a fragment or query string.
$fragment_query = preg_replace('/^[^#?]+/', '', $path->toString());
if (!empty($fragment_query)) {
$canonical .= $fragment_query;
}
}
if (!str_starts_with($canonical, '/')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment