From bf50f803996cb4a833fe23217320db2d0e150968 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 4 Nov 2020 07:58:04 +0100 Subject: [PATCH] Fix fatal error "Argument 2 passed to Friendica\Model\Post\Media::getAttachElement() must be of the type int, string given" --- src/Protocol/Feed.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 4eb638be3..ff35e9750 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -437,14 +437,14 @@ class Feed $enclosures = $xpath->query("enclosure|atom:link[@rel='enclosure']", $entry); foreach ($enclosures AS $enclosure) { $href = ""; - $length = ""; + $length = 0; $type = ""; foreach ($enclosure->attributes AS $attribute) { if (in_array($attribute->name, ["url", "href"])) { $href = $attribute->textContent; } elseif ($attribute->name == "length") { - $length = $attribute->textContent; + $length = (int)$attribute->textContent; } elseif ($attribute->name == "type") { $type = $attribute->textContent; }