From 4ae65a63c68706d392a39d5ec666552b04ace656 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 22 Oct 2025 18:31:49 +0000 Subject: [PATCH] photo_upload(): moderate photo items where observer has write_storage perm but not post_wall perm - fix issue #1940 --- include/photos.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/photos.php b/include/photos.php index a9f92e103..dc2a3e58a 100644 --- a/include/photos.php +++ b/include/photos.php @@ -475,6 +475,7 @@ function photo_upload($channel, $observer, $args) { } $force = true; } + $r = q("select id, edited from item where mid = '%s' and uid = %d limit 1", dbesc($item['mid']), intval($channel['channel_id']) @@ -541,6 +542,9 @@ function photo_upload($channel, $observer, $args) { 'item_origin' => 1, 'item_thread_top' => 1, 'item_private' => intval($acl->is_private()), + // If $observer has write_storage permission but does not have post_wall permission, + // we will let you moderate the item. + 'item_blocked' => ((perm_is_allowed($channel_id, $observer['xchan_hash'], 'post_wall')) ? 0 : ITEM_MODERATED), 'body' => $summary, 'plink' => $mid ];