Bugfix: allow any 'scheme:' uri

This commit is contained in:
djmaze 2021-03-09 14:50:43 +01:00
parent bc360eccf9
commit 59565275b1

View file

@ -710,7 +710,7 @@ abstract class HtmlUtils
if ($oElement->hasAttribute('href'))
{
$sHref = \trim($oElement->getAttribute('href'));
if (!\preg_match('/^(http[s]?|ftp|skype|mailto):/i', $sHref) && '//' !== \substr($sHref, 0, 2))
if (!\preg_match('/^([a-z]+):/i', $sHref) && '//' !== \substr($sHref, 0, 2))
{
$oElement->setAttribute('data-x-broken-href', $sHref);
$oElement->setAttribute('href', 'javascript:false');