mirror of
https://github.com/friendica/friendica
synced 2024-11-13 01:42:59 +00:00
Add support for Atom enclosure
This commit is contained in:
parent
9f693cc443
commit
a80d77f328
1 changed files with 5 additions and 8 deletions
|
@ -207,13 +207,10 @@ class Feed {
|
||||||
}
|
}
|
||||||
|
|
||||||
$items = [];
|
$items = [];
|
||||||
|
// Importing older entries first
|
||||||
|
for($i = $entries->length - 1; $i >= 0;--$i) {
|
||||||
|
$entry = $entries->item($i);
|
||||||
|
|
||||||
$entrylist = [];
|
|
||||||
|
|
||||||
foreach ($entries AS $entry) {
|
|
||||||
$entrylist[] = $entry;
|
|
||||||
}
|
|
||||||
foreach (array_reverse($entrylist) AS $entry) {
|
|
||||||
$item = array_merge($header, $author);
|
$item = array_merge($header, $author);
|
||||||
|
|
||||||
$alternate = $xpath->query("atom:link[@rel='alternate']", $entry)->item(0)->attributes;
|
$alternate = $xpath->query("atom:link[@rel='alternate']", $entry)->item(0)->attributes;
|
||||||
|
@ -309,7 +306,7 @@ class Feed {
|
||||||
|
|
||||||
$attachments = [];
|
$attachments = [];
|
||||||
|
|
||||||
$enclosures = $xpath->query("enclosure", $entry);
|
$enclosures = $xpath->query("enclosure|atom:link[@rel='enclosure']", $entry);
|
||||||
foreach ($enclosures AS $enclosure) {
|
foreach ($enclosures AS $enclosure) {
|
||||||
$href = "";
|
$href = "";
|
||||||
$length = "";
|
$length = "";
|
||||||
|
@ -317,7 +314,7 @@ class Feed {
|
||||||
$title = "";
|
$title = "";
|
||||||
|
|
||||||
foreach ($enclosure->attributes AS $attributes) {
|
foreach ($enclosure->attributes AS $attributes) {
|
||||||
if ($attributes->name == "url") {
|
if ($attributes->name == "url" || $attributes->name == "href") {
|
||||||
$href = $attributes->textContent;
|
$href = $attributes->textContent;
|
||||||
} elseif ($attributes->name == "length") {
|
} elseif ($attributes->name == "length") {
|
||||||
$length = $attributes->textContent;
|
$length = $attributes->textContent;
|
||||||
|
|
Loading…
Reference in a new issue