Skip to content

Commit

Permalink
fixed is_file() call with null (#53)
Browse files Browse the repository at this point in the history
Calling is_file() with null will throw an error in PHP 8.1
  • Loading branch information
brainfoolong authored Dec 13, 2021
1 parent 9c85196 commit 6bc7f0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Attestation/Format/FormatBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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;
Expand Down

0 comments on commit 6bc7f0f

Please sign in to comment.