From fb1e85baaf2f3870297c03984f3122d4ed6ad767 Mon Sep 17 00:00:00 2001 From: wn_ Date: Wed, 17 Nov 2021 19:29:42 +0000 Subject: [PATCH] Switch FeedParser back to described behavior for setting 'error'. Also some formatting. --- classes/feedparser.php | 10 ++++++---- 1 file 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;