diff options
author | Max Kostikov <max@kostikov.co> | 2019-11-08 23:39:04 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-11-08 23:39:04 +0100 |
commit | ec68ede79faffd5733c3eaa24df2e4fb3b54eeb9 (patch) | |
tree | c26098c1c0ebff705dc4ef4f324b8b1656c61b9a /Zotlabs/Module | |
parent | 3706afbd01164c9f322c605d6ec242e6ca4770fa (diff) | |
parent | 478014f02a9241ec6d5b5e9672968897176302d2 (diff) | |
download | volse-hubzilla-ec68ede79faffd5733c3eaa24df2e4fb3b54eeb9.tar.gz volse-hubzilla-ec68ede79faffd5733c3eaa24df2e4fb3b54eeb9.tar.bz2 volse-hubzilla-ec68ede79faffd5733c3eaa24df2e4fb3b54eeb9.zip |
Merge branch 'dev' into 'dev'
Dev sync
See merge request kostikov/core!4
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Item.php | 5 | ||||
-rw-r--r-- | Zotlabs/Module/Menu.php | 5 | ||||
-rw-r--r-- | Zotlabs/Module/Wall_attach.php | 21 |
3 files changed, 21 insertions, 10 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index cda8eabec..14881844d 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -817,11 +817,6 @@ class Item extends Controller { 'revision' => $r['data']['revision'] ); } - $ext = substr($r['data']['filename'],strrpos($r['data']['filename'],'.')); - if(strpos($r['data']['filetype'],'audio/') !== false) - $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][$i],$attach_link,$body); $i++; } diff --git a/Zotlabs/Module/Menu.php b/Zotlabs/Module/Menu.php index ee6b45f87..836f6a1d5 100644 --- a/Zotlabs/Module/Menu.php +++ b/Zotlabs/Module/Menu.php @@ -54,9 +54,10 @@ class Menu extends \Zotlabs\Web\Controller { if($_REQUEST['menu_system']) $_REQUEST['menu_flags'] |= MENU_SYSTEM; - $menu_id = ((argc() > 1) ? intval(argv(1)) : 0); + $menu_id = ((argc() > 2) ? intval(argv(2)) : 0); + if($menu_id) { - $_REQUEST['menu_id'] = intval(argv(1)); + $_REQUEST['menu_id'] = $menu_id; $r = menu_edit($_REQUEST); if($r) { menu_sync_packet($uid,get_observer_hash(),$menu_id); diff --git a/Zotlabs/Module/Wall_attach.php b/Zotlabs/Module/Wall_attach.php index 0ede3ad90..e1088d18f 100644 --- a/Zotlabs/Module/Wall_attach.php +++ b/Zotlabs/Module/Wall_attach.php @@ -86,7 +86,7 @@ class Wall_attach extends \Zotlabs\Web\Controller { $def_attach = get_pconfig($channel['channel_id'],'system','attach_path'); $r = attach_store($channel,(($observer) ? $observer['xchan_hash'] : ''),'', array('source' => 'editor', 'visible' => 0, 'album' => $def_album, 'directory' => $def_attach, 'allow_cid' => '<' . $channel['channel_hash'] . '>')); - + if(! $r['success']) { notice( $r['message'] . EOL); killme(); @@ -111,9 +111,24 @@ class Wall_attach extends \Zotlabs\Web\Controller { } if(strpos($r['data']['filetype'],'audio') === 0) { $url = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path']; - echo "\n\n" . '[zaudio]' . $url . '[/zaudio]' . "\n\n"; + $s = "\n\n" . '[zaudio]' . $url . '[/zaudio]' . "\n\n"; + } + if ($r['data']['filetype'] === 'image/svg+xml') { + $x = @file_get_contents('store/' . $channel['channel_address'] . '/' . $r['data']['os_path']); + if ($x) { + $bb = svg2bb($x); + if ($bb) { + $s .= "\n\n" . $bb; + } + else { + logger('empty return from svgbb'); + } + } + else { + logger('unable to read svg data file: ' . 'store/' . $channel['channel_address'] . '/' . $r['data']['os_path']); + } } - + $s .= "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n"; } |