Fix fatal error "Argument 2 passed to Friendica\Model\Post\Media::getAttachElement() must be of the type int, string given"

This commit is contained in:
Michael Vogel 2020-11-04 07:58:04 +01:00
parent 52ea22505d
commit bf50f80399

View file

@ -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;
}