diff options
-rw-r--r-- | Zotlabs/Module/Conversation.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Item.php | 15 |
2 files changed, 9 insertions, 9 deletions
diff --git a/Zotlabs/Module/Conversation.php b/Zotlabs/Module/Conversation.php index c3e6ae5ec..6ceba69f2 100644 --- a/Zotlabs/Module/Conversation.php +++ b/Zotlabs/Module/Conversation.php @@ -36,8 +36,7 @@ class Conversation extends Controller { // do we have the item (at all)? - $r = q("select parent_mid from item where mid = '%s' or uuid = '%s' $item_normal order by item_wall desc limit 1", - dbesc(z_root() . '/item/' . $item_id), + $r = q("select parent_mid from item where uuid = '%s' $item_normal order by item_wall desc limit 1", dbesc($item_id) ); diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index c0e59633b..97ccb312e 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -53,20 +53,21 @@ class Item extends Controller { if (argc() > 1 && argv(1) !== 'drop') { - $x = q("select uid, item_wall, llink, uuid from item where uuid = '%s'", + $x = q("select uid, item_wall, llink, uuid from item where uuid = '%s' order by item_wall desc", dbesc(argv(1)) ); + if ($x) { - foreach ($x as $xv) { - if (intval($xv['item_wall'])) { - $c = channelx_by_n($xv['uid']); - if ($c) { - goaway(z_root() . '/channel/' . $c['channel_address'] . '?mid=' . $xv['uuid']); - } + if ($x[0]['item_wall']) { + $c = channelx_by_n($x[0]['uid']); + if ($c) { + goaway(z_root() . '/channel/' . $c['channel_address'] . '?mid=' . $x[0]['uuid']); } } + goaway($x[0]['llink']); } + http_status_exit(404, 'Not found'); } |