From: wltb Date: Tue, 24 Sep 2013 14:43:47 +0000 (+0200) Subject: Feedparser: Only format fatal errors X-Git-Tag: 1.11~61^2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=d3305ff8de6ca9881021646221827d27240dba38;p=tt-rss.git Feedparser: Only format fatal errors --- 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();