aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-08-19 19:40:18 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-08-19 19:40:18 +0200
commite50e68719155c7d35e30bb203a403854f789d5a1 (patch)
treea10630cec177c6629fb0da38d96deb7258062698 /mod/item.php
parent07cd0c870f48ec838c23fa7c6966ceb1c41f06ab (diff)
parent4e3d295c909405da61d7ccd6c7bd99bd35c9feec (diff)
downloadvolse-hubzilla-e50e68719155c7d35e30bb203a403854f789d5a1.tar.gz
volse-hubzilla-e50e68719155c7d35e30bb203a403854f789d5a1.tar.bz2
volse-hubzilla-e50e68719155c7d35e30bb203a403854f789d5a1.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/mod/item.php b/mod/item.php
index 57a905395..ff6a834e6 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -1050,6 +1050,23 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body,
if(! strlen($image_uri))
continue;
$srch = '<' . $xchan_hash . '>';
+
+ $r = q("select folder from attach where hash = '%s' and uid = %d limit 1",
+ dbesc($image_uri),
+ intval($uid)
+ );
+ if($r && $r[0]['folder']) {
+ $f = q("select * from attach where hash = '%s' and is_dir = 1 and uid = %d limit 1",
+ dbesc($r[0]['folder']),
+ intval($uid)
+ );
+ if(($f) && (($f[0]['allow_cid']) || ($f[0]['allow_gid']) || ($f[0]['deny_cid']) || ($f[0]['deny_gid']))) {
+ $str_contact_allow = $f[0]['allow_cid'];
+ $str_group_allow = $f[0]['allow_gid'];
+ $str_contact_deny = $f[0]['deny_cid'];
+ $str_group_deny = $f[0]['deny_gid'];
+ }
+ }
$r = q("SELECT id FROM photo
WHERE allow_cid = '%s' AND allow_gid = '' AND deny_cid = '' AND deny_gid = ''