Switch FeedParser back to described behavior for setting 'error'.
Also some formatting.
This commit is contained in:
parent
aeb4137cbd
commit
fb1e85baaf
|
@ -42,9 +42,11 @@ class FeedParser {
|
||||||
if ($error) {
|
if ($error) {
|
||||||
foreach (libxml_get_errors() as $error) {
|
foreach (libxml_get_errors() as $error) {
|
||||||
if ($error->level == LIBXML_ERR_FATAL) {
|
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->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;
|
$this->type = $this::FEED_ATOM;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!isset($this->error) ){
|
if (!isset($this->error)) {
|
||||||
$this->error = "Unknown/unsupported feed type";
|
$this->error = "Unknown/unsupported feed type";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -184,7 +186,7 @@ class FeedParser {
|
||||||
if ($this->link) $this->link = trim($this->link);
|
if ($this->link) $this->link = trim($this->link);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if( !isset($this->error) ){
|
if (!isset($this->error)) {
|
||||||
$this->error = "Unknown/unsupported feed type";
|
$this->error = "Unknown/unsupported feed type";
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue