diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-09-14 14:20:49 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-09-14 19:22:52 +0000 |
commit | 6779729174acd4f872967ae0482a1701f3a1dd83 (patch) | |
tree | 59b7042d26f82d864171206e696afe96f6735df1 | |
parent | bce59cb2eb95c033ba4ed326b48a5d1c8d25fd44 (diff) | |
download | nextcloud-server-6779729174acd4f872967ae0482a1701f3a1dd83.tar.gz nextcloud-server-6779729174acd4f872967ae0482a1701f3a1dd83.zip |
fix: Do not try to set HTTP response code on already closed connectionbackport/47971/stable30
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>
-rw-r--r-- | lib/private/legacy/OC_Files.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/legacy/OC_Files.php b/lib/private/legacy/OC_Files.php index 76d61a98558..9870787e6f6 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); |