From 42691661c429477fe3febad6fe2d48c4c958c08b Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Mon, 1 Jul 2024 14:26:48 +0200 Subject: [PATCH] fix(files): Ensure that the hash method does not return null To match https://github.com/nextcloud/server/blob/beececf66068f57c416225efcde9b44ce5c2e835/lib/private/Files/View.php#L1050 - Fix https://github.com/nextcloud/server/issues/44110 Signed-off-by: Louis Chemineau --- lib/private/Files/Storage/Local.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index ac3696118f7ee..6f6ffc8cb9e50 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -399,8 +399,8 @@ public function fopen($path, $mode) { return $result; } - public function hash($type, $path, $raw = false) { - return hash_file($type, $this->getSourcePath($path), $raw); + public function hash($type, $path, $raw = false): string|false { + return hash_file($type, $this->getSourcePath($path), $raw) ?? false; } public function free_space($path) {