diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2023-12-16 16:05:52 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2023-12-16 16:05:52 +0100 |
commit | 19dd1fe86605bc85e8a0bf4efd6f195db258f60a (patch) | |
tree | 5d5b1fac3ad1760189ea0daf1bf5639e4ba0d100 /Zotlabs/Module/Item.php | |
parent | 6a5f78543fb2f5329e54209253b8c0d0f1d7a91d (diff) | |
parent | 69266cd6c65d228320dede32a343a9d3f3ea63df (diff) | |
download | volse-hubzilla-19dd1fe86605bc85e8a0bf4efd6f195db258f60a.tar.gz volse-hubzilla-19dd1fe86605bc85e8a0bf4efd6f195db258f60a.tar.bz2 volse-hubzilla-19dd1fe86605bc85e8a0bf4efd6f195db258f60a.zip |
Merge branch 'dev' into tests/test-db-setup-wip
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r-- | Zotlabs/Module/Item.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index b564396c9..25ccb0cbf 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -99,7 +99,7 @@ class Item extends Controller { $sql_extra = item_permissions_sql(0); if (!$i) { - $i = q("select id as item_id, uid from item where mid = '%s' $item_normal $sql_extra order by item_wall desc limit 1", + $i = q("select id as item_id, uid, item_private from item where mid = '%s' $item_normal $sql_extra order by item_wall desc limit 1", dbesc($r[0]['parent_mid']) ); } @@ -120,7 +120,10 @@ class Item extends Controller { $parents_str = ids_to_querystr($i, 'item_id'); - $total = q("SELECT count(*) AS count FROM item WHERE parent = %d $item_normal", + // We won't need to check for privacy mismatches if the verified observer is also owner + $parent_item_private = ((isset($i[0]['item_private'])) ? " and item_private = " . intval($i[0]['item_private']) . " " : ''); + + $total = q("SELECT count(*) AS count FROM item WHERE parent = %d $parent_item_private $item_normal ", intval($parents_str) ); @@ -134,7 +137,7 @@ class Item extends Controller { as_return_and_die($i ,$chan); } else { - $items = q("SELECT item.*, item.id AS item_id FROM item WHERE item.parent = %d $item_normal ORDER BY item.id", + $items = q("SELECT item.*, item.id AS item_id FROM item WHERE item.parent = %d $parent_item_private $item_normal ORDER BY item.id", intval($parents_str) ); |