X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FFeed.php;h=3981a8860cbf4c3f949885634bf9b703015c01a0;hb=e157c89dc7f625f1a05adf5c4779a5870852f14c;hp=d63b57b8c9522bd6a21d9387b1c7e0c93a217e50;hpb=2f9411f68fc4ed6a05e9e485ff44c0cf3ea1c291;p=friendica.git diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index d63b57b8c9..3981a8860c 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -17,9 +17,6 @@ use Friendica\Model\Item; use Friendica\Util\Network; use Friendica\Util\XML; -require_once 'include/dba.php'; -require_once 'include/items.php'; - /** * @brief This class contain functions to import feeds * @@ -28,17 +25,18 @@ class Feed { /** * @brief Read a RSS/RDF/Atom feed and create an item entry for it * - * @param string $xml The feed data - * @param array $importer The user record of the importer - * @param array $contact The contact record of the feed - * @param string $hub Unused dummy value for compatibility reasons - * @param bool $simulate If enabled, no data is imported + * @param string $xml The feed data + * @param array $importer The user record of the importer + * @param array $contact The contact record of the feed + * @param string $hub Unused dummy value for compatibility reasons + * @param bool $simulate If enabled, no data is imported * * @return array In simulation mode it returns the header and the first item + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ public static function import($xml, $importer, &$contact, &$hub, $simulate = false) { - $a = get_app(); + $a = \get_app(); if (!$simulate) { Logger::log("Import Atom/RSS feed '".$contact["name"]."' (Contact ".$contact["id"].") for user ".$importer["uid"], Logger::DEBUG); @@ -320,7 +318,6 @@ class Feed { $href = ""; $length = ""; $type = ""; - $title = ""; foreach ($enclosure->attributes AS $attribute) { if (in_array($attribute->name, ["url", "href"])) { @@ -350,7 +347,7 @@ class Feed { $tags .= ', '; } - $taglink = "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url]"; + $taglink = "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url]"; $tags .= $taglink; }