]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
Merge pull request #6380 from MrPetovan/bug/5148-get-cookies-from-safari
[friendica.git] / src / Protocol / DFRN.php
index b67b7c021fc76d5a10f85e00202db00fee54b3c6..f8405ee92b0b5e50da64c6037254ae6dd9cc1f6f 100644 (file)
@@ -37,12 +37,6 @@ use Friendica\Util\XML;
 use HTMLPurifier;
 use HTMLPurifier_Config;
 
-require_once 'boot.php';
-require_once 'include/dba.php';
-require_once "include/enotify.php";
-require_once "include/items.php";
-require_once "include/text.php";
-
 /**
  * @brief This class contain functions to create and send DFRN XML files
  */
@@ -1876,6 +1870,7 @@ class DFRN
                        "to_email" => $importer["email"],
                        "uid" => $importer["importer_uid"],
                        "item" => $msg,
+                       "parent" => $msg["parent-uri"],
                        "source_name" => $msg["from-name"],
                        "source_link" => $importer["url"],
                        "source_photo" => $importer["thumb"],
@@ -2637,7 +2632,7 @@ class DFRN
                        if (($item["object-type"] == ACTIVITY_OBJ_EVENT) && !$owner_unknown) {
                                Logger::log("Item ".$item["uri"]." seems to contain an event.", Logger::DEBUG);
                                $ev = Event::fromBBCode($item["body"]);
-                               if ((x($ev, "desc") || x($ev, "summary")) && x($ev, "start")) {
+                               if ((!empty($ev['desc']) || !empty($ev['summary'])) && !empty($ev['start'])) {
                                        Logger::log("Event in item ".$item["uri"]." was found.", Logger::DEBUG);
                                        $ev["cid"]     = $importer["id"];
                                        $ev["uid"]     = $importer["importer_uid"];
@@ -2925,7 +2920,7 @@ class DFRN
        public static function autoRedir(App $a, $contact_nick)
        {
                // prevent looping
-               if (x($_REQUEST, 'redir') && intval($_REQUEST['redir'])) {
+               if (!empty($_REQUEST['redir'])) {
                        return;
                }
 
@@ -3077,10 +3072,10 @@ class DFRN
         */
        private static function isEditedTimestampNewer($existing, $update)
        {
-               if (!x($existing, 'edited') || !$existing['edited']) {
+               if (empty($existing['edited'])) {
                        return true;
                }
-               if (!x($update, 'edited') || !$update['edited']) {
+               if (empty($update['edited'])) {
                        return false;
                }