mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Improved app security
This commit is contained in:
parent
b244462fa5
commit
8eb4588917
4 changed files with 20 additions and 1 deletions
|
|
@ -1100,6 +1100,13 @@ class HtmlUtils
|
|||
}
|
||||
}
|
||||
|
||||
$sLinkHref = \trim($oElement->getAttribute('xlink:href'));
|
||||
if ($sLinkHref && !\preg_match('/^(http[s]?):/i', $sLinkHref) && '//' !== \substr($sLinkHref, 0, 2))
|
||||
{
|
||||
$oElement->setAttribute('data-x-blocked-xlink-href', $sLinkHref);
|
||||
$oElement->removeAttribute('xlink:href');
|
||||
}
|
||||
|
||||
if (\in_array($sTagNameLower, array('a', 'form', 'area')))
|
||||
{
|
||||
$oElement->setAttribute('target', '_blank');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue