From 5308394c930e8ff75be573c95ad4454b92f742d4 Mon Sep 17 00:00:00 2001 From: Roland Eigelsreiter Date: Mon, 29 Nov 2021 07:54:50 +0100 Subject: [PATCH] fixed is_file() call with null Calling is_file() with null will throw an error in PHP 8.1 --- src/Attestation/Format/FormatBase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Attestation/Format/FormatBase.php b/src/Attestation/Format/FormatBase.php index d52ea6d..b2f1dfd 100644 --- a/src/Attestation/Format/FormatBase.php +++ b/src/Attestation/Format/FormatBase.php @@ -27,7 +27,7 @@ public function __construct($AttestionObject, AuthenticatorData $authenticatorDa */ public function __destruct() { // delete X.509 chain certificate file after use - if (\is_file($this->_x5c_tempFile)) { + if ($this->_x5c_tempFile && \is_file($this->_x5c_tempFile)) { \unlink($this->_x5c_tempFile); } } @@ -37,7 +37,7 @@ public function __destruct() { * @return string|null */ public function getCertificateChain() { - if (\is_file($this->_x5c_tempFile)) { + if ($this->_x5c_tempFile && \is_file($this->_x5c_tempFile)) { return \file_get_contents($this->_x5c_tempFile); } return null;