diff options
Diffstat (limited to 'Zotlabs/Module/Display.php')
-rw-r--r-- | Zotlabs/Module/Display.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 9e46d7620..f08aedc95 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -38,7 +38,14 @@ class Display extends Controller { $item_hash = $_REQUEST['mid']; } - $item_hash = unpack_link_id($item_hash); + $identifier = 'uuid'; + $encoded_item_hash = null; + + if (str_starts_with($item_hash, 'b64.')) { + $encoded_item_hash = $item_hash; + $item_hash = unpack_link_id($item_hash); + $identifier = 'mid'; + } if ($item_hash === false) { App::$error = 400; @@ -104,7 +111,7 @@ class Display extends Controller { $target_item = null; - $r = q("select id, uid, mid, parent, parent_mid, thr_parent, verb, item_type, item_deleted, author_xchan, item_blocked from item where mid = '%s' limit 1", + $r = q("select id, uid, mid, parent, parent_mid, thr_parent, verb, item_type, item_deleted, author_xchan, item_blocked from item where $identifier = '%s' limit 1", dbesc($item_hash) ); @@ -152,18 +159,11 @@ class Display extends Controller { call_hooks('item_custom_display', $target_item); $simple_update = ''; - if($update && $_SESSION['loadtime']) + if($update && isset($_SESSION['loadtime'])) $simple_update = " AND (( item_unseen = 1 AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) OR item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' ) "; if((! $update) && (! $load)) { - // if the target item is not a post (eg a like) we want to address its thread parent - - //$mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']); - - // if we got a decoded hash we must encode it again before handing to javascript - $mid = gen_link_id($target_item['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"; @@ -196,7 +196,7 @@ class Display extends Controller { '$dbegin' => '', '$verb' => '', '$net' => '', - '$mid' => (($mid) ? urlencode($mid) : '') + '$mid' => $encoded_item_hash ?? $item_hash )); head_add_link([ |