mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 10:09:20 +03:00
Additional securty fixes
This commit is contained in:
parent
f2918491d6
commit
007a03b8d4
5 changed files with 35 additions and 20 deletions
|
|
@ -865,24 +865,23 @@ class HtmlUtils
|
|||
$oElement->setAttribute('tabindex', '-1');
|
||||
}
|
||||
|
||||
foreach (array(
|
||||
'id', 'class',
|
||||
'contenteditable', 'designmode', 'formaction',
|
||||
'data-bind', 'data-reactid', 'xmlns', 'srcset',
|
||||
'data-x-skip-style'
|
||||
) as $sAttr)
|
||||
if ($oElement->hasAttributes() && isset($oElement->attributes) && $oElement->attributes)
|
||||
{
|
||||
@$oElement->removeAttribute($sAttr);
|
||||
}
|
||||
|
||||
foreach (array(
|
||||
'load', 'blur', 'error', 'focus', 'formchange', 'change',
|
||||
'click', 'dblclick', 'keydown', 'keypress', 'keyup',
|
||||
'mousedown', 'mouseenter', 'mouseleave', 'mousemove', 'mouseout', 'mouseover', 'mouseup',
|
||||
'move', 'resize', 'resizeend', 'resizestart', 'scroll', 'select', 'submit', 'upload'
|
||||
) as $sAttr)
|
||||
{
|
||||
@$oElement->removeAttribute('on'.$sAttr);
|
||||
foreach ($oElement->attributes as $oAttr)
|
||||
{
|
||||
if ($oAttr && !empty($oAttr->nodeName))
|
||||
{
|
||||
$sAttrName = \trim(\strtolower($oAttr->nodeName));
|
||||
if ('on' === \substr($sAttrName, 0, 2) || in_array($sAttrName, array(
|
||||
'id', 'class', 'contenteditable', 'designmode', 'formaction',
|
||||
'data-bind', 'data-reactid', 'xmlns', 'srcset', 'data-x-skip-style',
|
||||
'fscommand', 'seeksegmenttime'
|
||||
)))
|
||||
{
|
||||
@$oElement->removeAttribute($oAttr->nodeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($oElement->hasAttribute('href'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue