From d88bf9e527a880aaa6bec6c2acc7589b7ac2fbca Mon Sep 17 00:00:00 2001 From: yannis Date: Thu, 10 Jul 2025 11:29:19 +0200 Subject: [PATCH] feat: remove unecessary test permsgroupbyentitypluszero is set as an array before so cond is always true --- htdocs/user/api_token/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/api_token/card.php b/htdocs/user/api_token/card.php index 4e0373cb222..6b149f7c879 100644 --- a/htdocs/user/api_token/card.php +++ b/htdocs/user/api_token/card.php @@ -933,7 +933,7 @@ if ($action == 'create') { if ($obj->module == 'user' && $obj->perms == 'user' && $obj->subperms == 'password') { if ((!empty($object->admin) && !empty($objMod->rights_admin_allowed)) || in_array($obj->id, $tokenperms) /* if edited user owns this permissions */ || - (isset($permsgroupbyentitypluszero) && is_array($permsgroupbyentitypluszero) && in_array($obj->id, $permsgroupbyentitypluszero))) { + (in_array($obj->id, $permsgroupbyentitypluszero))) { print ' '.img_warning($langs->trans("AllowPasswordResetBySendingANewPassByEmail")); } } @@ -941,7 +941,7 @@ if ($action == 'create') { if ($obj->module == 'user' && $obj->perms == 'user' && ($obj->subperms == 'creer' || $obj->subperms == 'create')) { if ((!empty($object->admin) && !empty($objMod->rights_admin_allowed)) || in_array($obj->id, $tokenperms) /* if edited user owns this permissions */ || - (isset($permsgroupbyentitypluszero) && is_array($permsgroupbyentitypluszero) && in_array($obj->id, $permsgroupbyentitypluszero))) { + (in_array($obj->id, $permsgroupbyentitypluszero))) { print ' '.img_warning($langs->trans("AllowAnyPrivileges")); } }