From 3ecca468cbd1f23bbad557df33af6265184d1622 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 3 Aug 2022 15:16:48 +0200 Subject: [PATCH] Store SHA-256 hashes in wcf1_package_installation_file_log during WCFSetup see 01ec69848a725e649b045f26cd16720581071076 --- wcfsetup/install/files/lib/system/WCFSetup.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 6fe5de48f4..877dd42bfb 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -954,13 +954,19 @@ final class WCFSetup extends WCF // save file log if (!empty($fileInserts)) { $sql = "INSERT INTO wcf1_package_installation_file_log - (packageID, filename, application) - VALUES (?, ?, ?)"; + (packageID, filename, application, sha256, lastUpdated) + VALUES (?, ?, ?, ?, ?)"; $statement = self::getDB()->prepareStatement($sql); self::getDB()->beginTransaction(); foreach ($fileInserts as $file) { - $statement->execute([1, $file, 'wcf']); + $statement->execute([ + 1, + $file, + 'wcf', + \hash_file('sha256', \WCF_DIR . $file, true), + \TIME_NOW, + ]); } self::getDB()->commitTransaction(); } -- 2.20.1