From ddbc55d16611d3e7aa0c5af88072a004ff03c26d Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 7 Sep 2021 10:21:02 +0000 Subject: fix mod display regressions --- Zotlabs/Module/Display.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Zotlabs/Module/Display.php') diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 5ffb1346c..02a79f854 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -37,7 +37,15 @@ class Display extends \Zotlabs\Web\Controller { } if($_REQUEST['mid']) { - $item_hash = unpack_link_id($_REQUEST['mid']); + $item_hash = $_REQUEST['mid']; + } + + $item_hash = unpack_link_id($item_hash); + + if ($item_hash === false) { + App::$error = 400; + notice(t('Malformed message id.') . EOL); + return; } if(!$item_hash) { @@ -95,11 +103,6 @@ class Display extends \Zotlabs\Web\Controller { $target_item = null; - if ($item_hash === false) { - notice(t('Malformed message id.') . EOL); - return; - } - $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", dbesc($item_hash) ); @@ -374,7 +377,7 @@ class Display extends \Zotlabs\Web\Controller { '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)), '$author' => '', '$owner' => '', - '$profile_page' => xmlify(z_root() . '/display/' . $target_item['mid']), + '$profile_page' => xmlify(z_root() . '/display/' . gen_link_id($target_item['mid'])), )); $x = [ 'xml' => $atom, 'channel' => $channel, 'observer_hash' => $observer_hash, 'params' => $params ]; -- cgit v1.2.3