aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Display.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-02-01 11:42:55 +0000
committerMario <mario@mariovavti.com>2024-02-01 11:42:55 +0000
commitdd204ec34f473d7e0b133d35b08f3c4dc8d3ffef (patch)
tree3d995b7602c48721cf486585e1f3e3aa4b81fb0c /Zotlabs/Module/Display.php
parentb3a5dd8aa8c8990e6139fc817f9c9f706d2e0976 (diff)
downloadvolse-hubzilla-dd204ec34f473d7e0b133d35b08f3c4dc8d3ffef.tar.gz
volse-hubzilla-dd204ec34f473d7e0b133d35b08f3c4dc8d3ffef.tar.bz2
volse-hubzilla-dd204ec34f473d7e0b133d35b08f3c4dc8d3ffef.zip
start using uuid for internal reference instead of base64 encoded mid
Diffstat (limited to 'Zotlabs/Module/Display.php')
-rw-r--r--Zotlabs/Module/Display.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 9e46d7620..a1e8d0d1d 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)
);
@@ -157,13 +164,6 @@ class Display extends Controller {
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([