aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Entry.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-07-19 23:40:28 +0200
committerGravatar GitHub <noreply@github.com> 2023-07-19 23:40:28 +0200
commit1f05c923762a7f395cbb9c63121445f0e688a076 (patch)
treee2e822960f0655f320a7866980e5d731b49a5591 /app/Models/Entry.php
parentc35a9ee061a31b5d4b19e63bbe9882a7ecdcb053 (diff)
Fix enclosures in RSS output (#5540)
* Fix enclosures in RSS output fix https://github.com/FreshRSS/FreshRSS/issues/5539 * another iterable * Forgotten iterable
Diffstat (limited to 'app/Models/Entry.php')
-rw-r--r--app/Models/Entry.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 7e10367fa..77f39f256 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -235,12 +235,12 @@ HTML;
/** @return Traversable<array{'url':string,'type'?:string,'medium'?:string,'length'?:int,'title'?:string,'description'?:string,'credit'?:string,'height'?:int,'width'?:int,'thumbnails'?:array<string>}> */
public function enclosures(bool $searchBodyImages = false): Traversable {
$attributeEnclosures = $this->attributes('enclosures');
- if (is_array($attributeEnclosures)) {
+ if (is_iterable($attributeEnclosures)) {
// FreshRSS 1.20.1+: The enclosures are saved as attributes
yield from $attributeEnclosures;
}
try {
- $searchEnclosures = !is_array($attributeEnclosures) && (strpos($this->content, '<p class="enclosure-content') !== false);
+ $searchEnclosures = !is_iterable($attributeEnclosures) && (strpos($this->content, '<p class="enclosure-content') !== false);
$searchBodyImages &= (stripos($this->content, '<img') !== false);
$xpath = null;
if ($searchEnclosures || $searchBodyImages) {