Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
  • Loading branch information
come-nc authored and backportbot[bot] committed Sep 14, 2024
commit 045dd40ab12fba1be41c4466e143f13332fd5f7d
3 changes: 2 additions & 1 deletion lib/private/legacy/OC_Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ public static function get($dir, $files, $params = null) {
} 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);
Expand Down