Store SHA-256 hashes in wcf1_package_installation_file_log during WCFSetup
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 3 Aug 2022 13:16:48 +0000 (15:16 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 3 Aug 2022 13:16:48 +0000 (15:16 +0200)
see 01ec69848a725e649b045f26cd16720581071076

wcfsetup/install/files/lib/system/WCFSetup.class.php

index 6fe5de48f43afe2741493e8bda298f372b768f5f..877dd42bfbebf89b3286ac4df983646e9ce37730 100644 (file)
@@ -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();
         }