From 7863406080bf4ea1ca73d6ffd49aac315b447b31 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 12 Mar 2020 06:20:49 +0000 Subject: [PATCH] Prevent "null" permissions on photos --- src/Model/Photo.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 67c4fa2ea3..fa3ffe81b3 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -298,6 +298,13 @@ class Photo $backend_ref = $storage->put($Image->asString(), $backend_ref); } + // Prevent "null" permissions + if (!empty($uid)) { + $allow_cid = $allow_cid ?? '<' . $uid . '>'; + $allow_gid = $allow_gid ?? ''; + $deny_cid = $deny_cid ?? ''; + $deny_gid = $deny_gid ?? ''; + } $fields = [ "uid" => $uid, -- 2.39.5