From d3305ff8de6ca9881021646221827d27240dba38 Mon Sep 17 00:00:00 2001 From: wltb Date: Tue, 24 Sep 2013 16:43:47 +0200 Subject: [PATCH] Feedparser: Only format fatal errors --- classes/feedparser.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/classes/feedparser.php b/classes/feedparser.php index 22052bdb..07de73a9 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -62,8 +62,16 @@ class FeedParser { } } } - - $this->error = $this->format_error($error); + + $this->error = ""; + if($error) { + foreach(libxml_get_errors() as $error) { + if($error->level == LIBXML_ERR_FATAL) { + $this->error = $this->format_error($error); + break; //break here because currently we only show one error + } + } + } libxml_clear_errors(); $this->items = array(); -- 2.39.5