From 15e75446415af92081e3ae2b744b242e76989228 Mon Sep 17 00:00:00 2001 From: guillermogomez Date: Wed, 22 May 2024 21:29:34 -0400 Subject: [PATCH] Issue #609: When a file size is 0 bytes do not mark it as location error --- classes/local/store/object_file_system.php | 2 +- classes/local/store/s3/file_system.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/local/store/object_file_system.php b/classes/local/store/object_file_system.php index 10692f1a..c1f0d088 100644 --- a/classes/local/store/object_file_system.php +++ b/classes/local/store/object_file_system.php @@ -406,7 +406,7 @@ public function readfile(\stored_file $file) { $this->logger->log_object_read('readfile', $path, $file->get_filesize()); - if (!$success) { + if ($success === false) { manager::update_object_by_hash($file->get_contenthash(), OBJECT_LOCATION_ERROR); } } diff --git a/classes/local/store/s3/file_system.php b/classes/local/store/s3/file_system.php index d4689de0..e4a8fdba 100644 --- a/classes/local/store/s3/file_system.php +++ b/classes/local/store/s3/file_system.php @@ -59,7 +59,7 @@ public function readfile(\stored_file $file) { $this->get_logger()->end_timing(); $this->get_logger()->log_object_read('readfile', $path, $file->get_filesize()); - if (!$success) { + if ($success === false) { manager::update_object_by_hash($file->get_contenthash(), OBJECT_LOCATION_ERROR); throw new \file_exception('storedfilecannotreadfile', $file->get_filename()); }