From 0b5c9ad04441a56d9e0c59fd2c8e9b358056d36e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 20 Oct 2013 15:24:33 +0200 Subject: If the xpath enchancer fails, fallback to the original body --- articleenhancer/xpatharticleenhancer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'articleenhancer') diff --git a/articleenhancer/xpatharticleenhancer.php b/articleenhancer/xpatharticleenhancer.php index 93ceaf896..0a2d6e56c 100644 --- a/articleenhancer/xpatharticleenhancer.php +++ b/articleenhancer/xpatharticleenhancer.php @@ -86,7 +86,9 @@ class XPathArticleEnhancer implements ArticleEnhancer { $xpathResult = $this->substituteRelativeLinks($xpathResult, $item->getUrl()); $sanitizedResult = $this->purifier->purify($xpathResult); - $item->setBody($sanitizedResult); + if( $sanitizedResult ) { + $item->setBody($sanitizedResult); + } } } -- cgit v1.2.3