diff options
author | wltb <[email protected]> | 2013-09-26 19:56:45 +0200 |
---|---|---|
committer | wltb <[email protected]> | 2013-09-26 19:56:45 +0200 |
commit | 54f23d38a6d9e994575d2159b2277674149ae5d8 (patch) | |
tree | 7870c1fcec4eaa1c0eed37641f6d65a862b8d9b4 | |
parent | 4d49863f65e14190c8e460700f2bd197e724666c (diff) |
Feedparser: Store libXML fatal error messages in an array, repair error reporting
-rw-r--r-- | classes/feedparser.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/classes/feedparser.php b/classes/feedparser.php index 2942fb27d..4eaeb2429 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -2,6 +2,7 @@ class FeedParser { private $doc; private $error; + private $libxml_errors = array(); private $items; private $link; private $title; @@ -63,12 +64,12 @@ class FeedParser { } } - $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 + if(!isset($this->error)) //currently only the first error is reported + $this->error = $this->format_error($error); + $this->libxml_errors [] = $this->format_error($error); } } } @@ -216,6 +217,10 @@ class FeedParser { return $this->error; } + function errors() { + return $this->libxml_errors; + } + function get_link() { return $this->link; } |