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:
parent
52ea22505d
commit
bf50f80399
|
@ -437,14 +437,14 @@ class Feed
|
||||||
$enclosures = $xpath->query("enclosure|atom:link[@rel='enclosure']", $entry);
|
$enclosures = $xpath->query("enclosure|atom:link[@rel='enclosure']", $entry);
|
||||||
foreach ($enclosures AS $enclosure) {
|
foreach ($enclosures AS $enclosure) {
|
||||||
$href = "";
|
$href = "";
|
||||||
$length = "";
|
$length = 0;
|
||||||
$type = "";
|
$type = "";
|
||||||
|
|
||||||
foreach ($enclosure->attributes AS $attribute) {
|
foreach ($enclosure->attributes AS $attribute) {
|
||||||
if (in_array($attribute->name, ["url", "href"])) {
|
if (in_array($attribute->name, ["url", "href"])) {
|
||||||
$href = $attribute->textContent;
|
$href = $attribute->textContent;
|
||||||
} elseif ($attribute->name == "length") {
|
} elseif ($attribute->name == "length") {
|
||||||
$length = $attribute->textContent;
|
$length = (int)$attribute->textContent;
|
||||||
} elseif ($attribute->name == "type") {
|
} elseif ($attribute->name == "type") {
|
||||||
$type = $attribute->textContent;
|
$type = $attribute->textContent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue