From 5694a1aa00a1f92e3cced90803fdcc1c11d69cb9 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 4 Oct 2014 19:45:14 +0200 Subject: cleanup --- articleenhancer/xpatharticleenhancer.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'articleenhancer') diff --git a/articleenhancer/xpatharticleenhancer.php b/articleenhancer/xpatharticleenhancer.php index 8d0dba7e8..8681051d2 100644 --- a/articleenhancer/xpatharticleenhancer.php +++ b/articleenhancer/xpatharticleenhancer.php @@ -117,14 +117,14 @@ class XPathArticleEnhancer implements ArticleEnhancer { $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; - $noHTMLError = Security::scan($xmlString, $dom, function ($xml, $dom) { + $isOk = Security::scan($xmlString, $dom, function ($xml, $dom) { // wrap in div to prevent loadHTML from inserting weird elements $xml = '
' . $xml . '
'; return @$dom->loadHTML($xml, LIBXML_NONET | LIBXML_HTML_NODEFDTD | LIBXML_HTML_NOIMPLIED); }); - if($xmlString === '' || !$noHTMLError) { + if($xmlString === '' || !$isOk) { return false; } @@ -142,7 +142,6 @@ class XPathArticleEnhancer implements ArticleEnhancer { } } - // save dom to string and remove $xmlString = $dom->saveHTML(); // domdocument spoils the string with line breaks between the elements. strip them. -- cgit v1.2.3