X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FProtocol%2FFeed.php;h=c04e40b5e520d8871631e826c3310cc211b15ffe;hb=b02cdc8a7f84a4931e80027de42a80daa58581e1;hp=f80e6cf6c24790a8ecdcab06857e8cc4a842f187;hpb=2009c0619589b3b095c8c2e6b82405c3ba42c3ed;p=friendica.git diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index f80e6cf6c2..c04e40b5e5 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -10,12 +10,13 @@ use Friendica\Database\DBM; use Friendica\Core\System; use Friendica\Model\Item; use Friendica\Util\Network; +use Friendica\Content\Text\HTML; + use dba; use DOMDocument; use DOMXPath; require_once 'include/dba.php'; -require_once 'include/html2bbcode.php'; require_once 'include/items.php'; /** @@ -85,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; } } } @@ -98,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; } } } @@ -140,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; } } } @@ -218,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; } } } @@ -313,13 +314,13 @@ class Feed { $type = ""; $title = ""; - foreach ($enclosure->attributes AS $attributes) { - if ($attributes->name == "url" || $attributes->name == "href") { - $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"])) { @@ -360,7 +361,7 @@ class Feed { if (self::titleIsBody($item["title"], $body)) { $item["title"] = ""; } - $item["body"] = html2bbcode($body, $basepath); + $item["body"] = HTML::toBBCode($body, $basepath); if (($item["body"] == '') && ($item["title"] != '')) { $item["body"] = $item["title"]; @@ -429,6 +430,9 @@ class Feed { $item['guid'] = Item::guidFromUri($orig_plink, $a->get_hostname()); unset($item['uri']); unset($item['parent-uri']); + + // Set the delivery priority for "remote self" to "medium" + $notify = PRIORITY_MEDIUM; } $id = Item::insert($item, false, $notify);