mirror of
https://github.com/friendica/friendica
synced 2025-04-28 02:30:16 +00:00
Merge branch 'master' into develop
This commit is contained in:
commit
27d94023ee
70 changed files with 27138 additions and 26508 deletions
|
@ -86,9 +86,9 @@ class Feed {
|
|||
if ($xpath->query('/atom:feed')->length > 0) {
|
||||
$alternate = $xpath->query("atom:link[@rel='alternate']")->item(0)->attributes;
|
||||
if (is_object($alternate)) {
|
||||
foreach ($alternate AS $attributes) {
|
||||
if ($attributes->name == "href") {
|
||||
$author["author-link"] = $attributes->textContent;
|
||||
foreach ($alternate AS $attribute) {
|
||||
if ($attribute->name == "href") {
|
||||
$author["author-link"] = $attribute->textContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,9 +99,9 @@ class Feed {
|
|||
if ($author["author-link"] == "") {
|
||||
$self = $xpath->query("atom:link[@rel='self']")->item(0)->attributes;
|
||||
if (is_object($self)) {
|
||||
foreach ($self AS $attributes) {
|
||||
if ($attributes->name == "href") {
|
||||
$author["author-link"] = $attributes->textContent;
|
||||
foreach ($self AS $attribute) {
|
||||
if ($attribute->name == "href") {
|
||||
$author["author-link"] = $attribute->textContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,9 +141,9 @@ class Feed {
|
|||
}
|
||||
$avatar = $xpath->evaluate("atom:author/atom:link[@rel='avatar']")->item(0)->attributes;
|
||||
if (is_object($avatar)) {
|
||||
foreach ($avatar AS $attributes) {
|
||||
if ($attributes->name == "href") {
|
||||
$author["author-avatar"] = $attributes->textContent;
|
||||
foreach ($avatar AS $attribute) {
|
||||
if ($attribute->name == "href") {
|
||||
$author["author-avatar"] = $attribute->textContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -208,13 +208,10 @@ class Feed {
|
|||
}
|
||||
|
||||
$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);
|
||||
|
||||
$alternate = $xpath->query("atom:link[@rel='alternate']", $entry)->item(0)->attributes;
|
||||
|
@ -222,9 +219,9 @@ class Feed {
|
|||
$alternate = $xpath->query("atom:link", $entry)->item(0)->attributes;
|
||||
}
|
||||
if (is_object($alternate)) {
|
||||
foreach ($alternate AS $attributes) {
|
||||
if ($attributes->name == "href") {
|
||||
$item["plink"] = $attributes->textContent;
|
||||
foreach ($alternate AS $attribute) {
|
||||
if ($attribute->name == "href") {
|
||||
$item["plink"] = $attribute->textContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -310,20 +307,20 @@ class Feed {
|
|||
|
||||
$attachments = [];
|
||||
|
||||
$enclosures = $xpath->query("enclosure", $entry);
|
||||
$enclosures = $xpath->query("enclosure|atom:link[@rel='enclosure']", $entry);
|
||||
foreach ($enclosures AS $enclosure) {
|
||||
$href = "";
|
||||
$length = "";
|
||||
$type = "";
|
||||
$title = "";
|
||||
|
||||
foreach ($enclosure->attributes AS $attributes) {
|
||||
if ($attributes->name == "url") {
|
||||
$href = $attributes->textContent;
|
||||
} elseif ($attributes->name == "length") {
|
||||
$length = $attributes->textContent;
|
||||
} elseif ($attributes->name == "type") {
|
||||
$type = $attributes->textContent;
|
||||
foreach ($enclosure->attributes AS $attribute) {
|
||||
if (in_array($attribute->name, ["url", "href"])) {
|
||||
$href = $attribute->textContent;
|
||||
} elseif ($attribute->name == "length") {
|
||||
$length = $attribute->textContent;
|
||||
} elseif ($attribute->name == "type") {
|
||||
$type = $attribute->textContent;
|
||||
}
|
||||
}
|
||||
if (strlen($item["attach"])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue