aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-02-01 13:25:40 +0000
committerMario <mario@mariovavti.com>2024-02-01 13:25:40 +0000
commite89563eb4cbc3d4c8645992962affe930df24386 (patch)
tree8cdf8ee5195a426fca80eb4592fead81be1eaa19 /Zotlabs/Module
parentdd204ec34f473d7e0b133d35b08f3c4dc8d3ffef (diff)
downloadvolse-hubzilla-e89563eb4cbc3d4c8645992962affe930df24386.tar.gz
volse-hubzilla-e89563eb4cbc3d4c8645992962affe930df24386.tar.bz2
volse-hubzilla-e89563eb4cbc3d4c8645992962affe930df24386.zip
fix edgecase for notices and make mod hq backwards compatible
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Hq.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index 36ab8e410..ae6a016fc 100644
--- a/Zotlabs/Module/Hq.php
+++ b/Zotlabs/Module/Hq.php
@@ -37,6 +37,15 @@ class Hq extends \Zotlabs\Web\Controller {
$item_hash = $_REQUEST['mid'];
}
+ $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';
+ }
+
$item_normal = item_normal();
$item_normal_update = item_normal_update();
$sys = get_sys_channel();
@@ -49,7 +58,7 @@ class Hq extends \Zotlabs\Web\Controller {
// select the target item with a bias to our own item
$sql_order = ((local_channel() > $sys['channel_id']) ? 'DESC' : 'ASC');
- $r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where uid in (%d, %d) and uuid = '%s' order by uid $sql_order limit 2",
+ $r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where uid in (%d, %d) and $identifier = '%s' order by uid $sql_order limit 2",
intval(local_channel()),
intval($sys['channel_id']),
dbesc($item_hash)
@@ -151,7 +160,7 @@ class Hq extends \Zotlabs\Web\Controller {
'$dbegin' => '',
'$verb' => '',
'$net' => '',
- '$mid' => $item_hash
+ '$mid' => $encoded_item_hash ?? $item_hash
]);
}