]> git.mxchange.org Git - friendica.git/commitdiff
Some beautification
authorMichael Vogel <icarus@dabo.de>
Wed, 2 Mar 2016 22:39:50 +0000 (23:39 +0100)
committerMichael Vogel <icarus@dabo.de>
Wed, 2 Mar 2016 22:39:50 +0000 (23:39 +0100)
include/diaspora2.php

index baf117b10292e2f5c8ebc560565be954a32516b9..4d0e4c2cb8f3ca3b596c392b5b7595edc962adc1 100644 (file)
@@ -1524,16 +1524,16 @@ print_r($data);
 
                $body = diaspora2bb($raw_message);
 
-               if ($data->photo)
+               $datarray = array();
+
+               if ($data->photo) {
                        foreach ($data->photo AS $photo)
                                $body = "[img]".$photo->remote_photo_path.$photo->remote_photo_name."[/img]\n".$body;
 
-               $datarray = array();
-
-               if($data->photo->remote_photo_path AND $data->photo->remote_photo_name)
                        $datarray["object-type"] = ACTIVITY_OBJ_PHOTO;
-               else {
+               else {
                        $datarray["object-type"] = ACTIVITY_OBJ_NOTE;
+
                        // Add OEmbed and other information to the body
                        if (!self::is_redmatrix($contact["url"]))
                                $body = add_page_info_to_body($body, false, true);
@@ -1541,6 +1541,7 @@ print_r($data);
 
                $str_tags = "";
 
+               // This doesn't work. @todo Check if the "tag" field is filled in the "item_store" function.
                $cnt = preg_match_all("/@\[url=(.*?)\[\/url\]/ism", $body, $matches, PREG_SET_ORDER);
                if($cnt) {
                        foreach($matches as $mtch) {