]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: Do not try to set HTTP response code on already closed connection backport/47971/stable29 47980/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Sat, 14 Sep 2024 12:20:49 +0000 (14:20 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Sat, 14 Sep 2024 19:21:24 +0000 (19:21 +0000)
This avoids a PHP warning in the logs about trying to set the response
 code while the output already started. It’s useless to try to print an
 error page anyway in this situation because the connection was closed
 already.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/legacy/OC_Files.php

index 1b2f83941c87ab5062638bd17c8368ccf877b767..b8eb6fe1ed02090f5a52d1c6ac63ebfbee06a370 100644 (file)
@@ -233,7 +233,8 @@ class OC_Files {
                } catch (\OCP\Files\ConnectionLostException $ex) {
                        self::unlockAllTheFiles($dir, $files, $getType, $view, $filename);
                        OC::$server->getLogger()->logException($ex, ['level' => \OCP\ILogger::DEBUG]);
-                       \OC_Template::printErrorPage('Connection lost', $ex->getMessage(), 200);
+                       /* We do not print anything here, the connection is already closed */
+                       die();
                } catch (\Exception $ex) {
                        self::unlockAllTheFiles($dir, $files, $getType, $view, $filename);
                        OC::$server->getLogger()->logException($ex);