Skip to content

Commit

Permalink
Use file_exsists instead of file_get_contents to prevent warning
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos authored and backportbot-libresign[bot] committed Feb 28, 2024
1 parent 09d8eaa commit 8e78ba8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Handler/CertificateEngine/CfsslHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ public function isSetupOk(): bool {
return false;
};
$configPath = $this->getConfigPath();
$certificate = file_get_contents($configPath . '/ca.pem');
$privateKey = file_get_contents($configPath . '/ca-key.pem');
$certificate = file_exists($configPath . '/ca.pem');
$privateKey = file_exists($configPath . '/ca-key.pem');
if (!$certificate || !$privateKey) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Handler/CertificateEngine/OpenSslHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public function isSetupOk(): bool {
return false;
}
$configPath = $this->getConfigPath();
$certificate = file_get_contents($configPath . '/ca.pem');
$privateKey = file_get_contents($configPath . '/ca-key.pem');
$certificate = file_exists($configPath . '/ca.pem');
$privateKey = file_exists($configPath . '/ca-key.pem');
return $certificate && $privateKey;
}

Expand Down

0 comments on commit 8e78ba8

Please sign in to comment.