summaryrefslogtreecommitdiff
path: root/classes/feedparser.php
diff options
context:
space:
mode:
authorwn_ <[email protected]>2021-11-17 19:29:42 +0000
committerwn_ <[email protected]>2021-11-17 19:29:54 +0000
commitfb1e85baaf2f3870297c03984f3122d4ed6ad767 (patch)
tree4ad2269ed34b3be6d070cfc44ae1b14120cfa352 /classes/feedparser.php
parentaeb4137cbdb53e4f0b3127b96f1f9d9416a58205 (diff)
Switch FeedParser back to described behavior for setting 'error'.
Also some formatting.
Diffstat (limited to 'classes/feedparser.php')
-rw-r--r--classes/feedparser.php10
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;