Skip to content
Snippets Groups Projects
Commit 6b841cf0 authored by Vladimir Roudakov's avatar Vladimir Roudakov Committed by Robert Phillips
Browse files

#3432946 "Case issue"

parent 58d5030f
No related branches found
No related tags found
1 merge request!2#3432946 "Case issue"
......@@ -85,10 +85,10 @@ class ConvertUrlFilter extends FilterBase implements ContainerFactoryPluginInter
if (!$link->hasAttribute('href')) {
continue;
}
$path = mb_strtolower($link->getAttribute('href'));
$path = $link->getAttribute('href');
$url = parse_url($path);
if (isset($url['host']) && in_array(preg_replace('/^www./', '', $url['host']), $hosts, TRUE)) {
$link->setAttribute('href', preg_replace('/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)(:\d+)?/', '', $path));
if (isset($url['host']) && in_array(preg_replace('/^www\./', '', mb_strtolower($url['host'])), $hosts)) {
$link->setAttribute('href', preg_replace('/^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/\n]+)(:\d+)?/i', '', $path));
}
}
return new FilterProcessResult(Html::serialize($dom));
......
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