can't reset public to false because it may have been passed in as true and this would be wrong and cause even more subtle bugs. Reset to whatever value was passed in.

This commit is contained in:
friendica 2014-12-01 18:58:27 -08:00
parent f3b92c0ef2
commit 8e4e56b566

View File

@ -1419,7 +1419,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque
}
foreach($deliveries as $d) {
$public = false;
$local_public = $public;
$r = q("select * from channel where channel_hash = '%s' limit 1",
dbesc($d['hash'])
);
@ -1434,7 +1434,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque
// allow public postings to the sys channel regardless of permissions
if(($channel['channel_pageflags'] & PAGE_SYSTEM) && (! $arr['item_private']))
$public = true;
$local_public = true;
$tag_delivery = tgroup_check($channel['channel_id'],$arr);
@ -1453,7 +1453,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque
}
}
if((! perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)) && (! $tag_delivery) && (! $public)) {
if((! perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)) && (! $tag_delivery) && (! $local_public)) {
logger("permission denied for delivery to channel {$channel['channel_id']} {$channel['channel_address']}");
$result[] = array($d['hash'],'permission denied',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']);
continue;
@ -1488,7 +1488,7 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque
// the top level post is unlikely to be imported and
// this is just an exercise in futility.
if((! $relay) && (! $request) && (! $public)
if((! $relay) && (! $request) && (! $local_public)
&& perm_is_allowed($channel['channel_id'],$sender['hash'],'send_stream')) {
proc_run('php', 'include/notifier.php', 'request', $channel['channel_id'], $sender['hash'], $arr['parent_mid']);
}