diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-10-29 15:11:58 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-10-29 15:11:58 -0700 |
commit | a1e28bb669b1a9376b9c15bc32a3496ef0d906b9 (patch) | |
tree | 203a13b58831ac6c426b0f538e8b12b5498479f0 /include | |
parent | dc4bd531a4aee036d28dfc233662ac71e4f6e7df (diff) | |
parent | c5aedb14a962290140b1f2b7cc1d2b62296c7624 (diff) | |
download | volse-hubzilla-a1e28bb669b1a9376b9c15bc32a3496ef0d906b9.tar.gz volse-hubzilla-a1e28bb669b1a9376b9c15bc32a3496ef0d906b9.tar.bz2 volse-hubzilla-a1e28bb669b1a9376b9c15bc32a3496ef0d906b9.zip |
Merge https://github.com/redmatrix/hubzilla into pending_merge
Diffstat (limited to 'include')
-rw-r--r-- | include/bb2diaspora.php | 5 | ||||
-rw-r--r-- | include/photo/photo_driver.php | 6 |
2 files changed, 3 insertions, 8 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']); } } diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index 810e0cdc7..e980a96e1 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -593,16 +593,12 @@ 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); if($result['success']) { $img_str = $result['body']; + $type = guess_image_type($photo, $result['header']); $h = explode("\n",$result['header']); if($h) { |