From 9545fd20a5cb0072c099ce9ffdc5f80e75ffc9e5 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 31 Aug 2023 17:06:22 +0200 Subject: [PATCH] fix #4686 --- src/Files/Files.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Files/Files.php b/src/Files/Files.php index 288ca4e..b7bdc30 100644 --- a/src/Files/Files.php +++ b/src/Files/Files.php @@ -143,9 +143,13 @@ class Files return $f->getBasename($suffix); } - public static function hashFileAttributes($path) + public static function hashFileAttributes($path, $additionalAttributes = []) { - return hash('sha256', $path . '/$$' . filesize($path) . '///' . filemtime($path)); + $str = $path . '/$$' . filesize($path) . '///' . filemtime($path); + if ($additionalAttributes) { + $str .= '$$$' . print_r($additionalAttributes, true); + } + return hash('sha256', $str); } public static function copyFile($from, $to, $hashAlgo = false, $touch = true, $throwExceptionIfSourceNotExists = true) -- 2.39.5