X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fitems.php;h=c04bef01c3de0ecb72a8e0c98d52d303f60313e1;hb=8779f22b5f341e1adbe562b94101cf954f2dcee9;hp=456853d80d516f614300830cc398bf9517a1ced5;hpb=724a58e79a664b65a3b68a4e3eb7fc88e1958af5;p=friendica.git diff --git a/include/items.php b/include/items.php index 456853d80d..c04bef01c3 100644 --- a/include/items.php +++ b/include/items.php @@ -19,7 +19,6 @@ use Friendica\Util\Network; use Friendica\Util\ParseUrl; use Friendica\Util\Temporal; -require_once 'include/bbcode.php'; require_once 'include/text.php'; require_once 'mod/share.php'; require_once 'include/enotify.php'; @@ -30,7 +29,7 @@ function add_page_info_data($data, $no_photos = false) { // It maybe is a rich content, but if it does have everything that a link has, // then treat it that way if (($data["type"] == "rich") && is_string($data["title"]) && - is_string($data["text"]) && (sizeof($data["images"]) > 0)) { + is_string($data["text"]) && !empty($data["images"])) { $data["type"] = "link"; } @@ -64,7 +63,7 @@ function add_page_info_data($data, $no_photos = false) { $text .= " title='".$data["title"]."'"; } - if (sizeof($data["images"]) > 0) { + if (!empty($data["images"])) { $preview = str_replace(["[", "]"], ["[", "]"], htmlentities($data["images"][0]["src"], ENT_QUOTES, 'UTF-8', false)); // if the preview picture is larger than 500 pixels then show it in a larger mode // But only, if the picture isn't higher than large (To prevent huge posts) @@ -229,7 +228,7 @@ function add_page_info_to_body($body, $texturl = false, $no_photos = false) { * * @TODO find proper type-hints */ -function consume_feed($xml, $importer, &$contact, &$hub, $datedir = 0, $pass = 0) { +function consume_feed($xml, $importer, $contact, &$hub, $datedir = 0, $pass = 0) { if ($contact['network'] === NETWORK_OSTATUS) { if ($pass < 2) { // Test - remove before flight @@ -291,7 +290,7 @@ function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') { return; } - $push_url = Config::get('system','url') . '/pubsub/' . $r[0]['nickname'] . '/' . $contact['id']; + $push_url = System::baseUrl() . '/pubsub/' . $r[0]['nickname'] . '/' . $contact['id']; // Use a single verify token, even if multiple hubs $verify_token = ((strlen($contact['hub-verify'])) ? $contact['hub-verify'] : random_string());