return self::DOMAIN_PLACEHOLDER .
$path . '#';
} public function replace(string
$content, string
$host, SalesChannelContext
$context): string
{ return Profiler::
trace('seo-url-replacer',
function D
) use ($content,
$host,
$context) { $matches =
[];
if (preg_match_all('/' . self::DOMAIN_PLACEHOLDER . '[^#]*#/',
$content,
$matches)) { $mapping =
$this->
createDefaultMapping($matches[0
]);
$seoMapping =
$this->
createSeoMapping($context,
$mapping);
foreach ($seoMapping as $key =>
$value) { $seoMapping[$key] =
$host . '/' .
ltrim($value, '/'
);
} return (string) \
preg_replace_callback('/' . self::DOMAIN_PLACEHOLDER . '[^#]*#/',
static fn (array
$match) =>
$seoMapping[$match[0
]],
$content);
} return $content;
});
}