Fix for displaying public items

This commit is contained in:
Michael 2018-07-16 04:00:57 +00:00
commit 0e8fa34156
3 changed files with 10 additions and 6 deletions

View file

@ -204,6 +204,10 @@ function can_write_wall($owner)
return true;
}
if (local_user() && ($owner == 0)) {
return true;
}
if (remote_user()) {
// use remembered decision and avoid a DB lookup for each and every display item
// DO NOT use this function if there are going to be multiple owners
@ -339,7 +343,7 @@ function item_permissions_sql($owner_id, $remote_verified = false, $groups = nul
AND `item`.allow_gid = ''
AND `item`.deny_cid = ''
AND `item`.deny_gid = ''
AND `item`.private = 0
AND `item`.private != 1
";
// Profile owner - everything is visible

View file

@ -1137,7 +1137,7 @@ function redir_private_images($a, &$item)
continue;
}
if ((local_user() == $item['uid']) && ($item['private'] != 0) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN)) {
if ((local_user() == $item['uid']) && ($item['private'] == 1) && ($item['contact-id'] != $a->contact['id']) && ($item['network'] == NETWORK_DFRN)) {
$img_url = 'redir?f=1&quiet=1&url=' . urlencode($mtch[1]) . '&conurl=' . urlencode($item['author-link']);
$item['body'] = str_replace($mtch[0], '[img]' . $img_url . '[/img]', $item['body']);
}