Merge https://github.com/redmatrix/hubzilla into pending_merge
This commit is contained in:
commit
a1e28bb669
@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -90,7 +90,6 @@ function editpost_content(&$a) {
|
||||
$category .= ', ';
|
||||
$category .= $cat['term'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($itm[0]['attach']) {
|
||||
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user