From cf38b62993b52a9b9952ae94898d78ed856901e4 Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 18 Oct 2021 23:31:33 +0200 Subject: [PATCH] public fields fix --- update.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/update.php b/update.php index f5d310830..64bd7a9c3 100644 --- a/update.php +++ b/update.php @@ -55,6 +55,7 @@ use Friendica\Model\Photo; use Friendica\Model\Post; use Friendica\Model\Profile; use Friendica\Model\Storage; +use Friendica\Security\PermissionSet\Depository\PermissionSet; use Friendica\Worker\Delivery; // Post-update script of PR 5751 @@ -1028,3 +1029,12 @@ function update_1439() } DBA::close($intros); } + +function update_1440() +{ + // Fix wrong public permissionset + DBA::p("UPDATE `profile_field` SET `psid` = ? WHERE psid IN (SELECT `id` FROM `permissionset` WHERE `id` != ? AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = '')", PermissionSet::PUBLIC, PermissionSet::PUBLIC); + DBA::delete('permissionset', ["`id` != ? AND `allow_cid` = '' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = ''", PermissionSet::PUBLIC]); + + return Update::SUCCESS; +}