summaryrefslogtreecommitdiffstats
path: root/articleenhancer
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-10-04 19:45:14 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-10-04 19:45:14 +0200
commit5694a1aa00a1f92e3cced90803fdcc1c11d69cb9 (patch)
tree4edb9120261d4e75e639a7b6d7cd2c46204fadb6 /articleenhancer
parent1d22c4ce5c8b8940bc44a24add493b5d7ba41cd9 (diff)
cleanup
Diffstat (limited to 'articleenhancer')
-rw-r--r--articleenhancer/xpatharticleenhancer.php5
1 files changed, 2 insertions, 3 deletions
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 = '<div>' . $xml . '</div>';
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 <body></body>
$xmlString = $dom->saveHTML();
// domdocument spoils the string with line breaks between the elements. strip them.