diff options
author | zotlabs <mike@macgirvin.com> | 2017-11-21 17:32:09 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-11-21 17:32:09 -0800 |
commit | 2cb3ccbf1462e89f63e9b804f438c95d9d22d72a (patch) | |
tree | 489e1bf3a3ed092bb66412abdb9b150cbe3a6e0a /Zotlabs | |
parent | fb1e3cba8b7a2d5f56a22eebe80314811e4add65 (diff) | |
parent | d942818bd9d9e90db7a3083bfe33a54732f6184d (diff) | |
download | volse-hubzilla-2cb3ccbf1462e89f63e9b804f438c95d9d22d72a.tar.gz volse-hubzilla-2cb3ccbf1462e89f63e9b804f438c95d9d22d72a.tar.bz2 volse-hubzilla-2cb3ccbf1462e89f63e9b804f438c95d9d22d72a.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Hq.php | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index 92dfc8587..78087c0f9 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -45,21 +45,26 @@ class Hq extends \Zotlabs\Web\Controller { if(! $item_hash) { $r = q("SELECT mid FROM item - WHERE uid = %d - AND mid = parent_mid - $item_normal + WHERE uid = %d + AND item_thread_top = 1 ORDER BY created DESC limit 1", - local_channel() + intval(local_channel()) ); - $item_hash = 'b64.' . base64url_encode($r[0]['mid']); - if(!$item_hash) { + if(!$r[0]['mid']) { \App::$error = 404; notice( t('Item not found.') . EOL); return; } + + $item_hash = 'b64.' . base64url_encode($r[0]['mid']); } + + if(strpos($item_hash,'b64.') === 0) + $decoded = @base64url_decode(substr($item_hash,4)); + if($decoded) + $item_hash = $decoded; $updateable = false; @@ -101,11 +106,6 @@ class Hq extends \Zotlabs\Web\Controller { $target_item = null; - if(strpos($item_hash,'b64.') === 0) - $decoded = @base64url_decode(substr($item_hash,4)); - if($decoded) - $item_hash = $decoded; - $r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where mid like '%s' limit 1", dbesc($item_hash . '%') ); |