]> git.mxchange.org Git - friendica.git/commitdiff
Fix permissionset query
authorMichael <heluecht@pirati.ca>
Sat, 28 Sep 2019 20:42:33 +0000 (20:42 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 28 Sep 2019 20:42:33 +0000 (20:42 +0000)
src/Model/PermissionSet.php

index c9b2b17b67223b0608d0a3fe8eb89b430d5111c3..90448806d8bd1e8cc62022bf33117dc1e0662310 100644 (file)
@@ -89,11 +89,9 @@ class PermissionSet extends BaseObject
 
                $contact_str = '<' . $contact_id . '>';
 
-               $condition = ["`uid` = ? AND (`allow_cid` = '' OR`allow_cid` REGEXP ?)
-                       AND (`deny_cid` = '' OR NOT `deny_cid` REGEXP ?)
-                       AND (`allow_gid` = '' OR `allow_gid` REGEXP ?)
-                       AND (`deny_gid` = '' OR NOT `deny_gid` REGEXP ?)",
-                       $uid, $contact_str, $contact_str, $group_str, $group_str];
+               $condition = ["`uid` = ? AND (NOT (`deny_cid` REGEXP ? OR deny_gid REGEXP ?)
+                       AND (allow_cid REGEXP ? OR allow_gid REGEXP ? OR (allow_cid = '' AND allow_gid = '')))",
+                       $uid, $contact_str, $group_str, $contact_str, $group_str];
 
                $ret = DBA::select('permissionset', ['id'], $condition);
                $set = [];