aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/OC_Files.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-09-14 14:20:49 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-09-14 14:20:49 +0200
commite54eef5ae37c088cb38f1eea9cf8849d2a36c6e1 (patch)
tree586a9dd8807d199c0d6f437797e4930a0f88024d /lib/private/legacy/OC_Files.php
parenta751ff7b93039b9e24e6a29fec50482dd07f7dbf (diff)
downloadnextcloud-server-e54eef5ae37c088cb38f1eea9cf8849d2a36c6e1.tar.gz
nextcloud-server-e54eef5ae37c088cb38f1eea9cf8849d2a36c6e1.zip
fix: Do not try to set HTTP response code on already closed connection
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>
Diffstat (limited to 'lib/private/legacy/OC_Files.php')
-rw-r--r--lib/private/legacy/OC_Files.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php
index 07caba42ff2..8e23d70c690 100644
--- a/lib/private/legacy/OC_Files.php
+++ b/lib/private/legacy/OC_Files.php
@@ -198,7 +198,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);