From 0a9b2b6b15bcf3f3b2fe604defd0cd99934f992b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 29 Oct 2015 11:29:11 +0100 Subject: possibly better fox for profil photo image type issue --- include/photo/photo_driver.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 810e0cdc7..f9b6e5ea8 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -593,11 +593,6 @@ function import_xchan_photo($photo,$xchan,$thing = false) { if($photo) { $filename = basename($photo); - $type = guess_image_type($photo); - - if(! $type) - $type = 'image/jpeg'; - $result = z_fetch_url($photo,true); @@ -614,6 +609,7 @@ function import_xchan_photo($photo,$xchan,$thing = false) { } } } + $type = guess_image_type($photo, $result['header']); } } else { -- cgit v1.2.3 From d66be62516c1297135d707f0d565e100651529d5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 29 Oct 2015 11:34:30 +0100 Subject: move it up --- include/photo/photo_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index f9b6e5ea8..e980a96e1 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -598,6 +598,7 @@ function import_xchan_photo($photo,$xchan,$thing = false) { if($result['success']) { $img_str = $result['body']; + $type = guess_image_type($photo, $result['header']); $h = explode("\n",$result['header']); if($h) { @@ -609,7 +610,6 @@ function import_xchan_photo($photo,$xchan,$thing = false) { } } } - $type = guess_image_type($photo, $result['header']); } } else { -- cgit v1.2.3 From ec28dee728b847f2363a53fb11e003d818c8e1cb Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 29 Oct 2015 12:58:32 +0100 Subject: update to latest object --- include/bb2diaspora.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index d10ed57eb..7cba40672 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -309,9 +309,8 @@ function bb2diaspora_itembody($item, $force_update = false) { $is_photo = (($item['obj_type'] == ACTIVITY_OBJ_PHOTO) ? true : false); if($is_photo) { $object = json_decode($item['object'],true); - if($object['link'][2]) { - $photo_bb = '[zrl=' . rawurldecode($object['id']) . ']' . '[zmg=' . $object['link'][2]['width'] . 'x' . $object['link'][2]['height'] . ']' . rawurldecode($object['link'][2]['href']) . '[/zmg]' . '[/zrl]'; - $item['body'] = (($item['body']) ? $photo_bb . $item['body'] : $photo_bb); + if($object['bbcode']) { + $item['body'] = (($item['body']) ? $object['bbcode'] . "\r\n" . $item['body'] : $object['bbcode']); } } -- cgit v1.2.3 From c5aedb14a962290140b1f2b7cc1d2b62296c7624 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 29 Oct 2015 19:46:21 +0100 Subject: fix #83 --- mod/editpost.php | 1 - mod/item.php | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/editpost.php b/mod/editpost.php index 1bee16ee7..2f999858f 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -90,7 +90,6 @@ function editpost_content(&$a) { $category .= ', '; $category .= $cat['term']; } - } if($itm[0]['attach']) { diff --git a/mod/item.php b/mod/item.php index 4dcf8edd7..591dc8407 100644 --- a/mod/item.php +++ b/mod/item.php @@ -607,6 +607,7 @@ function item_post(&$a) { if(preg_match_all('/(\[attachment\](.*?)\[\/attachment\])/',$body,$match)) { $attachments = array(); + $i = 0; foreach($match[2] as $mtch) { $attach_link = ''; $hash = substr($mtch,0,strpos($mtch,',')); @@ -626,7 +627,8 @@ function item_post(&$a) { $attach_link = '[audio]' . z_root() . '/attach/' . $r['data']['hash'] . '/' . $r['data']['revision'] . (($ext) ? $ext : '') . '[/audio]'; elseif(strpos($r['data']['filetype'],'video/') !== false) $attach_link = '[video]' . z_root() . '/attach/' . $r['data']['hash'] . '/' . $r['data']['revision'] . (($ext) ? $ext : '') . '[/video]'; - $body = str_replace($match[1],$attach_link,$body); + $body = str_replace($match[1][$i],$attach_link,$body); + $i++; } } -- cgit v1.2.3