diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-09-07 11:28:42 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-09-07 11:28:42 +0200 |
commit | 6143f490426144fc15cf35c0faa936f487e6c046 (patch) | |
tree | 05944d640e82dd1fe92cb0996dfcccd5626d7586 /Zotlabs/Module/Display.php | |
parent | 607c4146349541565b82b86811c193b4f9da23fe (diff) | |
download | volse-hubzilla-6143f490426144fc15cf35c0faa936f487e6c046.tar.gz volse-hubzilla-6143f490426144fc15cf35c0faa936f487e6c046.tar.bz2 volse-hubzilla-6143f490426144fc15cf35c0faa936f487e6c046.zip |
fix an issue where some encoded mids were not found in /display allthough they existed
Diffstat (limited to 'Zotlabs/Module/Display.php')
-rw-r--r-- | Zotlabs/Module/Display.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 11c75219d..3ac0a628d 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -133,7 +133,14 @@ class Display extends \Zotlabs\Web\Controller { if((! $update) && (! $load)) { $static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1); - + + //if the target item is not a post (eg a like) want to address its thread parent + $mid = (($target_item['verb'] == ACTIVITY_POST) ? $item_hash : $target_item['thr_parent']); + + //if we got a decoded hash we must encode it again before handing to javascript + if($decoded) + $mid = 'b64.' . base64url_encode($mid); + $o .= '<div id="live-display"></div>' . "\r\n"; $o .= "<script> var profile_uid = " . ((intval(local_channel())) ? local_channel() : (-1)) . "; var netargs = '?f='; var profile_page = " . \App::$pager['page'] . "; </script>\r\n"; @@ -165,8 +172,7 @@ class Display extends \Zotlabs\Web\Controller { '$dend' => '', '$dbegin' => '', '$verb' => '', - //if the target item is not a post (eg a like) want to address its thread parent - '$mid' => (($target_item['verb'] == ACTIVITY_POST) ? $item_hash : $target_item['thr_parent']) + '$mid' => $mid )); head_add_link([ @@ -323,6 +329,7 @@ class Display extends \Zotlabs\Web\Controller { $r = q("SELECT id, item_deleted FROM item WHERE mid = '%s' LIMIT 1", dbesc($item_hash) ); + if($r) { if(intval($r[0]['item_deleted'])) { notice( t('Item has been removed.') . EOL ); |