Skip to content
Snippets Groups Projects

ISTWCMS-7266: Refactor link handling logic in UwCblLinks block.

Merged Igor Biki requested to merge feature/ISTWCMS-7266-ibiki-links_and_titles into 1.1.x
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
@@ -973,7 +973,9 @@ class UwCblLinks extends BlockBase implements ContainerFactoryPluginInterface {
// Detects if there is a fragment or query string.
$fragment_query = preg_replace('/^[^#?]+/', '', $path->toString());
if (!empty($fragment_query)) {
// Need to check if fragment/query starts with # or ?, to avoid
// a scenario where the link is returned unchanged.
if (!empty($fragment_query) && (str_starts_with($fragment_query, '#') || str_starts_with($fragment_query, '?'))) {
$canonical .= $fragment_query;
}
}
Loading