Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Apr 7, 2024
1 parent c69ead1 commit f4805e0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Auth/Source/X509userCert.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ public function authenticate(array &$state): void
throw new Exception("Should never be reached");
}

$ldap_certs = array_map([$entry, 'getAttribute'], $this->ldapusercert);
$ldap_certs = [];
foreach ($this->ldapusercert as $attr) {
$ldap_certs[$attr] = $entry->getAttribute($attr);
}

if (empty($ldap_certs)) {
Logger::error('authX509: no certificate found in LDAP for dn=' . $dn);

Check warning on line 211 in src/Auth/Source/X509userCert.php

View workflow job for this annotation

GitHub Actions / Quality control

PossiblyNullOperand

src/Auth/Source/X509userCert.php:211:78: PossiblyNullOperand: Cannot concatenate with a possibly null null|string (see https://psalm.dev/080)

Check warning on line 211 in src/Auth/Source/X509userCert.php

View workflow job for this annotation

GitHub Actions / Quality control

PossiblyNullOperand

src/Auth/Source/X509userCert.php:211:78: PossiblyNullOperand: Cannot concatenate with a possibly null null|string (see https://psalm.dev/080)
$state['authX509.error'] = "UNKNOWNCERT";
Expand All @@ -214,7 +218,7 @@ public function authenticate(array &$state): void

$merged_ldapcerts = [];
foreach ($this->ldapusercert as $attr) {
$merged_ldapcerts = array_merge($merged_ldapcerts, $ldap_certs[0][$attr]);
$merged_ldapcerts = array_merge($merged_ldapcerts, $ldap_certs[$attr]);

Check failure on line 221 in src/Auth/Source/X509userCert.php

View workflow job for this annotation

GitHub Actions / Quality control

PossiblyNullArgument

src/Auth/Source/X509userCert.php:221:64: PossiblyNullArgument: Argument 2 of array_merge cannot be null, possibly null value provided (see https://psalm.dev/078)

Check failure on line 221 in src/Auth/Source/X509userCert.php

View workflow job for this annotation

GitHub Actions / Quality control

PossiblyNullArgument

src/Auth/Source/X509userCert.php:221:64: PossiblyNullArgument: Argument 2 of array_merge cannot be null, possibly null value provided (see https://psalm.dev/078)
}
$ldap_certs = $merged_ldapcerts;

Expand Down

0 comments on commit f4805e0

Please sign in to comment.