Skip to content
Snippets Groups Projects
Unverified Commit 42dfe62f authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #20483 from seamuslee001/hash_equals_string

[php8-compat][NFC] Ensure that the 2nd parameter of hash_equals is a …
parents 2bc3e01b 294503a9
Branches
Tags
No related merge requests found
......@@ -158,7 +158,7 @@ class Authenticator {
// If any one of these passes, then we allow the authentication.
$passGuard = [];
$passGuard[] = in_array('site_key', $useGuards) && defined('CIVICRM_SITE_KEY') && hash_equals(CIVICRM_SITE_KEY, $tgt->siteKey);
$passGuard[] = in_array('site_key', $useGuards) && defined('CIVICRM_SITE_KEY') && hash_equals(CIVICRM_SITE_KEY, (string) $tgt->siteKey);
$passGuard[] = in_array('perm', $useGuards) && isset($perms[$tgt->credType]) && \CRM_Core_Permission::check($perms[$tgt->credType], $tgt->contactId);
// JWTs are signed by us. We don't need user to prove that they're allowed to use them.
$passGuard[] = ($tgt->credType === 'jwt');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment