From 647c65a640f3e4c4b27e96f63684be2a2f55674f Mon Sep 17 00:00:00 2001 From: Jan Messer Date: Tue, 4 Apr 2023 22:01:35 +0200 Subject: [PATCH] [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 bcc992caa5df6..3338c00f579f5 100644 --- a/lib/private/Security/CertificateManager.php +++ b/lib/private/Security/CertificateManager.php @@ -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();