diff options
author | wn_ <[email protected]> | 2021-11-17 19:29:42 +0000 |
---|---|---|
committer | wn_ <[email protected]> | 2021-11-17 19:29:54 +0000 |
commit | fb1e85baaf2f3870297c03984f3122d4ed6ad767 (patch) | |
tree | 4ad2269ed34b3be6d070cfc44ae1b14120cfa352 /classes/feedparser.php | |
parent | aeb4137cbdb53e4f0b3127b96f1f9d9416a58205 (diff) |
Switch FeedParser back to described behavior for setting 'error'.
Also some formatting.
Diffstat (limited to 'classes/feedparser.php')
-rw-r--r-- | classes/feedparser.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/classes/feedparser.php b/classes/feedparser.php index f5649d2f8..6ce69cc89 100644 --- a/classes/feedparser.php +++ b/classes/feedparser.php @@ -42,9 +42,11 @@ class FeedParser { if ($error) { foreach (libxml_get_errors() as $error) { if ($error->level == LIBXML_ERR_FATAL) { - if ($this->error) //currently only the first error is reported + // currently only the first error is reported + if (!isset($this->error)) { $this->error = $this->format_error($error); - $this->libxml_errors [] = $this->format_error($error); + } + $this->libxml_errors[] = $this->format_error($error); } } } @@ -85,7 +87,7 @@ class FeedParser { $this->type = $this::FEED_ATOM; break; default: - if (!isset($this->error) ){ + if (!isset($this->error)) { $this->error = "Unknown/unsupported feed type"; } return; @@ -184,7 +186,7 @@ class FeedParser { if ($this->link) $this->link = trim($this->link); } else { - if( !isset($this->error) ){ + if (!isset($this->error)) { $this->error = "Unknown/unsupported feed type"; } return; |