diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 21 | ||||
-rw-r--r-- | Zotlabs/Module/Item.php | 5 | ||||
-rw-r--r-- | Zotlabs/Module/Menu.php | 5 | ||||
-rw-r--r-- | Zotlabs/Module/Wall_attach.php | 4 |
4 files changed, 18 insertions, 17 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 844127ee3..2014d68af 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -87,8 +87,8 @@ class Activity { $headers = [ 'Accept' => 'application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"', 'Host' => $m['host'], - '(request-target)' => 'get ' . get_request_string($url), - 'Date' => datetime_convert('UTC','UTC','now','D, d M Y H:i:s') . ' UTC' + 'Date' => datetime_convert('UTC','UTC', 'now', 'D, d M Y h:i:s \\G\\M\\T'), + '(request-target)' => 'get ' . get_request_string($url) ]; if (isset($token)) { $headers['Authorization'] = 'Bearer ' . $token; @@ -401,26 +401,30 @@ class Activity { $ret = []; - if($item['tag']) { - foreach($item['tag'] as $t) { - if(! array_key_exists('type',$t)) + if ($item['tag'] && is_array($item['tag'])) { + $ptr = $item['tag']; + if (! array_key_exists(0,$ptr)) { + $ptr = [ $ptr ]; + } + foreach ($ptr as $t) { + if (! array_key_exists('type',$t)) $t['type'] = 'Hashtag'; switch($t['type']) { case 'Hashtag': - $ret[] = [ 'ttype' => TERM_HASHTAG, 'url' => ((isset($t['href'])) ? $t['href'] : $t['id']), 'term' => escape_tags((substr($t['name'],0,1) === '#') ? substr($t['name'],1) : $t['name']) ]; + $ret[] = [ 'ttype' => TERM_HASHTAG, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'],0,1) === '#') ? substr($t['name'],1) : $t['name']) ]; break; case 'Mention': $mention_type = substr($t['name'],0,1); - if($mention_type === '!') { + if ($mention_type === '!') { $ret[] = [ 'ttype' => TERM_FORUM, 'url' => $t['href'], 'term' => escape_tags(substr($t['name'],1)) ]; } else { $ret[] = [ 'ttype' => TERM_MENTION, 'url' => $t['href'], 'term' => escape_tags((substr($t['name'],0,1) === '@') ? substr($t['name'],1) : $t['name']) ]; } break; - + default: break; } @@ -431,6 +435,7 @@ class Activity { } + static function encode_taxonomy($item) { $ret = []; 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..780e82950 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,7 +111,7 @@ 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"; } $s .= "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n"; |