]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
disable formatbar in xs screens
[friendica.git] / include / items.php
index 610729bbbe094db6b7d4afa9eb512ff5519c5089..2d7597dcd68c6666a090fad3cc67607cd308421e 100644 (file)
@@ -29,6 +29,10 @@ function add_page_info_data(array $data, $no_photos = false)
 {
        Addon::callHooks('page_info_data', $data);
 
+       if (empty($data['type'])) {
+               return '';
+       }
+
        // 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"]) &&
@@ -264,23 +268,10 @@ function consume_feed($xml, array $importer, array $contact, &$hub, $datedir = 0
 
        if ($contact['network'] === Protocol::DFRN) {
                logger("Consume DFRN messages", LOGGER_DEBUG);
-
-               $r = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`,
-                                       `contact`.`pubkey` AS `cpubkey`,
-                                       `contact`.`prvkey` AS `cprvkey`,
-                                       `contact`.`thumb` AS `thumb`,
-                                       `contact`.`url` as `url`,
-                                       `contact`.`name` as `senderName`,
-                                       `user`.*
-                       FROM `contact`
-                       LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
-                       WHERE `contact`.`id` = %d AND `user`.`uid` = %d",
-                       DBA::escape($contact["id"]), DBA::escape($importer["uid"])
-               );
-
-               if (DBA::isResult($r)) {
+               $dfrn_importer = DFRN::getImporter($contact["id"], $importer["uid"]);
+               if (!empty($dfrn_importer)) {
                        logger("Now import the DFRN feed");
-                       DFRN::import($xml, $r[0], true);
+                       DFRN::import($xml, $dfrn_importer, true);
                        return;
                }
        }
@@ -384,7 +375,7 @@ function drop_item($id)
 
        if ((local_user() == $item['uid']) || $contact_id) {
                // Check if we should do HTML-based delete confirmation
-               if ($_REQUEST['confirm']) {
+               if (!empty($_REQUEST['confirm'])) {
                        // <form> can't take arguments in its "action" parameter
                        // so add any arguments as hidden inputs
                        $query = explode_querystring($a->query_string);
@@ -408,7 +399,7 @@ function drop_item($id)
                        ]);
                }
                // Now check how the user responded to the confirmation query
-               if ($_REQUEST['canceled']) {
+               if (!empty($_REQUEST['canceled'])) {
                        goaway(System::baseUrl() . '/' . $_SESSION['return_url']);
                }