Skip to content

Node.js based forum software built for the modern web

fix: #12389, update privilege group check

Barış Soner Uşaklı87a79059f0b0
diff --git a/src/groups/index.js b/src/groups/index.js
index 7faf8d692a..8aef1a7b51 100644
--- a/src/groups/index.js
+++ b/src/groups/index.js
@@ -56,7 +56,7 @@ Groups.removeEphemeralGroups = function (groups) {
return groups;
};
-const isPrivilegeGroupRegex = /^cid:(?:\d+|admin):privileges:[\w\-:]+$/;
+const isPrivilegeGroupRegex = /^cid:(?:-?\d+|admin):privileges:[\w\-:]+$/;
Groups.isPrivilegeGroup = function (groupName) {
return isPrivilegeGroupRegex.test(groupName);
};
diff --git a/src/plugins/hooks.js b/src/plugins/hooks.js
index f10cb6ca81..aa471af6a8 100644
--- a/src/plugins/hooks.js
+++ b/src/plugins/hooks.js
@@ -233,7 +233,7 @@ function hookHandlerPromise(hook, hookObj, params) {
if (hook.startsWith('filter:') && returned !== undefined) {
_resolve(returned);
} else if (hook.startsWith('static:') && hookObj.method.length <= 1) {
- // make sure it is resolved if static hook doesn't return anything and doesn't use callback
+ // make sure it is resolved if static hook doesn't use callback
_resolve();
}
});