From 374e48e90f8385b3cf169a0cab00f3c152870ce4 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 fb3da10d..de30f1d2 100644 --- a/classes/local/store/object_file_system.php +++ b/classes/local/store/object_file_system.php @@ -512,7 +512,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 dd911092..93637dd4 100644 --- a/classes/local/store/s3/file_system.php +++ b/classes/local/store/s3/file_system.php @@ -71,7 +71,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()); }