From bad5a6e84abbca86257170094351f0d2ebec40ea Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 2 Mar 2016 23:39:50 +0100 Subject: [PATCH] Some beautification --- include/diaspora2.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/diaspora2.php b/include/diaspora2.php index baf117b10..4d0e4c2cb 100644 --- a/include/diaspora2.php +++ b/include/diaspora2.php @@ -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) {