Merge pull request #9489 from annando/fatal

Fix fatal error
This commit is contained in:
Hypolite Petovan 2020-11-04 07:24:51 -05:00 committed by GitHub
commit d47d45e83f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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