aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <redmatrix@redmatrix.me>2015-04-19 23:16:17 -0700
committerfriendica <redmatrix@redmatrix.me>2015-04-19 23:16:17 -0700
commita707e9b9f523fdb6e37c37666651b3b3d4510e94 (patch)
treec01ee62f5d01c2d15cccdaded6caafd00d3df8ea /mod
parent9cc8b44579ad0620d79c675b3449461db8d4e732 (diff)
downloadvolse-hubzilla-a707e9b9f523fdb6e37c37666651b3b3d4510e94.tar.gz
volse-hubzilla-a707e9b9f523fdb6e37c37666651b3b3d4510e94.tar.bz2
volse-hubzilla-a707e9b9f523fdb6e37c37666651b3b3d4510e94.zip
issue #178, searching for words such as 'data' would return private items regardless of their unobscured content.
Diffstat (limited to 'mod')
-rw-r--r--mod/search.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/mod/search.php b/mod/search.php
index e235f720a..6d79f5eee 100644
--- a/mod/search.php
+++ b/mod/search.php
@@ -153,24 +153,26 @@ function search_content(&$a,$update = 0, $load = false) {
}
if(local_channel()) {
$r = q("SELECT $prefix mid, item.id as item_id, item.* from item
- WHERE item_restrict = 0
+ WHERE item_restrict = 0 AND ( item_flags & %d ) = 0
AND ((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND item_private = 0 )
OR ( `item`.`uid` = %d )) OR item.owner_xchan = '%s' )
$sql_extra
$suffix $pager_sql ",
+ intval(ITEM_OBSCURED),
intval(local_channel()),
dbesc($sys['xchan_hash'])
);
}
if($r === null) {
$r = q("SELECT $prefix mid, item.id as item_id, item.* from item
- WHERE item_restrict = 0
+ WHERE item_restrict = 0 AND ( item_flags & %d ) = 0
AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = ''
AND `item`.`deny_gid` = '' AND item_private = 0 )
and owner_xchan in ( " . stream_perms_xchans(($observer) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
$pub_sql ) OR owner_xchan = '%s')
$sql_extra
$suffix $pager_sql",
+ intval(ITEM_OBSCURED),
dbesc($sys['xchan_hash'])
);
}