fix attachment permissions when they also contain an image.
This commit is contained in:
15
mod/item.php
15
mod/item.php
@@ -1086,6 +1086,21 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body,
|
||||
intval($uid)
|
||||
);
|
||||
}
|
||||
$r = q("select id from attach where hash = '%s' and uid = %d limit 1",
|
||||
dbesc($image_uri),
|
||||
intval($uid)
|
||||
);
|
||||
if($r) {
|
||||
q("update attach SET allow_cid = '%s', allow_gid = '%s', deny_cid = '%s', deny_gid = '%s'
|
||||
WHERE id = %d AND uid = %d",
|
||||
dbesc($str_contact_allow),
|
||||
dbesc($str_group_allow),
|
||||
dbesc($str_contact_deny),
|
||||
dbesc($str_group_deny),
|
||||
intval($r[0]['id']),
|
||||
intval($uid)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ function wall_attach_post(&$a) {
|
||||
// }
|
||||
// }
|
||||
|
||||
$r = attach_store($channel,(($observer) ? $observer['xchan_hash'] : ''),array('source' => 'editor', 'visible' => 0, 'contact_allow' => array($channel['channel_hash'])));
|
||||
$r = attach_store($channel,(($observer) ? $observer['xchan_hash'] : ''),'', array('source' => 'editor', 'visible' => 0, 'contact_allow' => array($channel['channel_hash'])));
|
||||
|
||||
if(! $r['success']) {
|
||||
notice( $r['message'] . EOL);
|
||||
|
||||
Reference in New Issue
Block a user