diff options
Diffstat (limited to 'classes/feeditem')
| -rwxr-xr-x | classes/feeditem/atom.php | 8 | ||||
| -rwxr-xr-x | classes/feeditem/common.php | 2 | ||||
| -rwxr-xr-x | classes/feeditem/rss.php | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php index cac6d8c54..59bf403b3 100755 --- a/classes/feeditem/atom.php +++ b/classes/feeditem/atom.php @@ -43,7 +43,8 @@ class FeedItem_Atom extends FeedItem_Common { $links = $this->elem->getElementsByTagName("link"); foreach ($links as $link) { - if ($link && $link->hasAttribute("href") && + /** @phpstan-ignore-next-line */ + if ($link->hasAttribute("href") && (!$link->hasAttribute("rel") || $link->getAttribute("rel") == "alternate" || $link->getAttribute("rel") == "standout")) { @@ -180,7 +181,8 @@ class FeedItem_Atom extends FeedItem_Common { $encs = []; foreach ($links as $link) { - if ($link && $link->hasAttribute("href") && $link->hasAttribute("rel")) { + /** @phpstan-ignore-next-line */ + if ($link->hasAttribute("href") && $link->hasAttribute("rel")) { $base = $this->xpath->evaluate("string(ancestor-or-self::*[@xml:base][1]/@xml:base)", $link); if ($link->getAttribute("rel") == "enclosure") { @@ -199,7 +201,7 @@ class FeedItem_Atom extends FeedItem_Common { } } - $encs = array_merge($encs, parent::get_enclosures()); + array_push($encs, ...parent::get_enclosures()); return $encs; } diff --git a/classes/feeditem/common.php b/classes/feeditem/common.php index 6a9be8aca..fde481179 100755 --- a/classes/feeditem/common.php +++ b/classes/feeditem/common.php @@ -189,7 +189,7 @@ abstract class FeedItem_Common extends FeedItem { $tmp = []; foreach ($cats as $rawcat) { - $tmp = array_merge($tmp, explode(",", $rawcat)); + array_push($tmp, ...explode(",", $rawcat)); } $tmp = array_map(function($srccat) { diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index 7017d04e9..132eabff5 100755 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -153,7 +153,7 @@ class FeedItem_RSS extends FeedItem_Common { array_push($encs, $enc); } - $encs = array_merge($encs, parent::get_enclosures()); + array_push($encs, ...parent::get_enclosures()); return $encs; } |