mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-14 11:25:55 +00:00
tweak strip_harmful_tags() for php 5.3.2 compatibility (refs #620)
This commit is contained in:
@@ -2685,16 +2685,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($entry->hasAttributes()) {
|
if ($entry->hasAttributes()) {
|
||||||
foreach (iterator_to_array($entry->attributes) as $attr) {
|
$attrs_to_remove = array();
|
||||||
|
|
||||||
|
foreach ($entry->attributes as $attr) {
|
||||||
|
|
||||||
if (strpos($attr->nodeName, 'on') === 0) {
|
if (strpos($attr->nodeName, 'on') === 0) {
|
||||||
$entry->removeAttributeNode($attr);
|
array_push($attrs_to_remove, $attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($attr->nodeName, $disallowed_attributes)) {
|
if (in_array($attr->nodeName, $disallowed_attributes)) {
|
||||||
$entry->removeAttributeNode($attr);
|
array_push($attrs_to_remove, $attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($attrs_to_remove as $attr) {
|
||||||
|
$entry->removeAttributeNode($attr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user