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;