From 7b4281baaa14f2f44cd4bba116a671c80586902a Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 22 Sep 2014 13:00:08 +0200 Subject: backport to old libxml version --- articleenhancer/globalarticleenhancer.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'articleenhancer') diff --git a/articleenhancer/globalarticleenhancer.php b/articleenhancer/globalarticleenhancer.php index 512d51697..1b6713ef7 100644 --- a/articleenhancer/globalarticleenhancer.php +++ b/articleenhancer/globalarticleenhancer.php @@ -24,8 +24,7 @@ class GlobalArticleEnhancer implements ArticleEnhancer { */ public function enhance(Item $item) { $dom = new \DOMDocument(); - @$dom->loadHTML($item->getBody(), LIBXML_HTML_NOIMPLIED | - LIBXML_HTML_NODEFDTD); + @$dom->loadHTML($item->getBody()); $xpath = new \DOMXpath($dom); // remove youtube autoplay @@ -46,6 +45,12 @@ class GlobalArticleEnhancer implements ArticleEnhancer { } } + // remove removeChild($dom->firstChild); + + // remove + $dom->replaceChild($dom->firstChild->firstChild->firstChild, $dom->firstChild); + // save all changes back to the item $item->setBody(trim($dom->saveHTML())); -- cgit v1.2.3