From 067c94e671a29d5e369e0f330da89b77b4c6ac73 Mon Sep 17 00:00:00 2001 From: Roland Angerer Date: Fri, 21 Jun 2013 13:40:27 +0200 Subject: allowing to cleanup attributes as well --- init.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.php b/init.php index e99744a..d83110e 100644 --- a/init.php +++ b/init.php @@ -121,7 +121,12 @@ class Af_Feedmod extends Plugin implements IHandler foreach ($config['cleanup'] as $cleanup) { $nodelist = $xpath->query('//'.$cleanup, $basenode); foreach ($nodelist as $node) { - $node->parentNode->removeChild($node); + if ($node instanceof DOMAttr) { + $node->ownerElement->removeAttributeNode($node); + } + else { + $node->parentNode->removeChild($node); + } } } } -- cgit v1.3.1