Browse Source

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>
pull/47971/head
Côme Chilliet 1 year ago
parent
commit
e54eef5ae3
No known key found for this signature in database GPG Key ID: A3E2F658B28C760A
  1. 3
      lib/private/legacy/OC_Files.php

3
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);

Loading…
Cancel
Save