Replace not working "redir" link with a working one

This commit is contained in:
Michael 2019-09-09 21:37:26 +00:00
parent 2dcb9926bc
commit 8fc8e26e23
2 changed files with 3 additions and 1 deletions

View File

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

View File

@ -656,6 +656,8 @@ class Photo extends BaseObject
continue; continue;
} }
/// @todo Check if $str_contact_allow does contain a public forum. Then set the permissions to public.
$fields = ['allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow, $fields = ['allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow,
'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny]; 'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny];
$condition = ['resource-id' => $image_uri, 'uid' => $uid]; $condition = ['resource-id' => $image_uri, 'uid' => $uid];