From 13c3c90e6538faef9eb8138c3944e0150715b9ab Mon Sep 17 00:00:00 2001 From: Indrek Haav Date: Fri, 29 Apr 2022 09:46:20 +0300 Subject: [PATCH] Skip non-files when loading certificates --- src/AuthenticationResponseValidatorBuilder.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/AuthenticationResponseValidatorBuilder.php b/src/AuthenticationResponseValidatorBuilder.php index e76b89b..22b37a2 100644 --- a/src/AuthenticationResponseValidatorBuilder.php +++ b/src/AuthenticationResponseValidatorBuilder.php @@ -44,6 +44,7 @@ public function getTrustedCaCertificates() public function withTrustedCaCertificatesFolder(string $trustedCertsPath) : AuthenticationResponseValidatorBuilder { foreach (array_diff(scandir($trustedCertsPath), array('.', '..')) as $file) { + if (!is_file($trustedCertsPath.$file)) continue; $caCertificate = file_get_contents($trustedCertsPath.$file); $caCert = Certificate::fromPEM(PEM::fromString($caCertificate)); $this->trustedCaCertificates[] = $caCert;