Skip to content

Commit

Permalink
[BUGFIX] throw exception instead of error if unable to create file ha…
Browse files Browse the repository at this point in the history
…ndler (only exceptions are catch)

Signed-off-by: Jan Messer <jan@mtec-studios.ch>
  • Loading branch information
Messj1 committed Apr 6, 2023
1 parent 7a44386 commit 647c65a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/Security/CertificateManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ public function createCertificateBundle(): void {
$tmpPath = $certPath . '.tmp' . $this->random->generate(10, ISecureRandom::CHAR_DIGITS);
$fhCerts = $this->view->fopen($tmpPath, 'w');

if (!is_resource($fhCerts)) {
throw new \RuntimeException('Unable to open file handler to create certificate bundle "' . $tmpPath . '".');
}

// Write user certificates
foreach ($certs as $cert) {
$file = $path . '/uploads/' . $cert->getName();
Expand Down

0 comments on commit 647c65a

Please sign in to comment.