From 364f3f5f26056fac82fb7f249852341fa69d2630 Mon Sep 17 00:00:00 2001 From: Jan Messer Date: Tue, 4 Apr 2023 22:01:35 +0200 Subject: [BUGFIX] throw exception instead of error if unable to create file handler (only exceptions are catch) Signed-off-by: Jan Messer --- lib/private/Security/CertificateManager.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php index f1107130887..f22a06641de 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -147,6 +147,10 @@ class CertificateManager implements ICertificateManager { $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(); -- cgit v1.2.3