incorrect check for sys ownership

This commit is contained in:
friendica 2014-12-19 00:28:36 -08:00
parent be9143447d
commit 9c445e9817

View File

@ -157,6 +157,7 @@ function display_content(&$a, $update = 0, $load = false) {
require_once('include/identity.php'); require_once('include/identity.php');
$sys = get_sys_channel(); $sys = get_sys_channel();
$sysid = $sys['channel_id'];
if(local_user()) { if(local_user()) {
$r = q("SELECT * from item $r = q("SELECT * from item
@ -178,8 +179,8 @@ function display_content(&$a, $update = 0, $load = false) {
// in case somebody turned off public access to sys channel content using permissions // in case somebody turned off public access to sys channel content using permissions
// make that content unsearchable by ensuring the owner_xchan can't match // make that content unsearchable by ensuring the owner_xchan can't match
if(! perm_is_allowed($sys['channel_id'],$observer_hash,'view_stream')) if(! perm_is_allowed($sysid,$observer_hash,'view_stream'))
$sys['xchan_hash'] .= 'disabled'; $sysid = 0;
$r = q("SELECT * from item $r = q("SELECT * from item
@ -188,11 +189,11 @@ function display_content(&$a, $update = 0, $load = false) {
AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND (((( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = ''
AND `item`.`deny_gid` = '' AND item_private = 0 ) AND `item`.`deny_gid` = '' AND item_private = 0 )
and owner_xchan in ( " . stream_perms_xchans(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " )) and owner_xchan in ( " . stream_perms_xchans(($observer_hash) ? (PERMS_NETWORK|PERMS_PUBLIC) : PERMS_PUBLIC) . " ))
OR owner_xchan = '%s') OR uid = %d )
$sql_extra ) $sql_extra )
limit 1", limit 1",
dbesc($target_item['parent_mid']), dbesc($target_item['parent_mid']),
dbesc($sys['xchan_hash']) intval($sysid)
); );
} }