From d8d16ece5e50931047fb98137f87cffb26e136ff Mon Sep 17 00:00:00 2001 From: kwadwo Date: Fri, 15 Feb 2013 07:47:50 -0800 Subject: [PATCH] data in PhabricatorFile hashed using sha1 Summary: Hash file content using sha1 Test Plan: None provided Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4969 --- src/applications/files/storage/PhabricatorFile.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php index 97b01ecc91..d74f995b42 100644 --- a/src/applications/files/storage/PhabricatorFile.php +++ b/src/applications/files/storage/PhabricatorFile.php @@ -121,7 +121,7 @@ final class PhabricatorFile extends PhabricatorFileDAO $file = id(new PhabricatorFile())->loadOneWhere( 'name = %s AND contentHash = %s LIMIT 1', self::normalizeFileName(idx($params, 'name')), - PhabricatorHash::digest($data)); + self::hashFileContent($data)); if (!$file) { $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); @@ -231,7 +231,7 @@ final class PhabricatorFile extends PhabricatorFileDAO $file->setName($file_name); $file->setByteSize(strlen($data)); $file->setAuthorPHID($authorPHID); - $file->setContentHash(PhabricatorHash::digest($data)); + $file->setContentHash(self::hashFileContent($data)); $file->setStorageEngine($engine_identifier); $file->setStorageHandle($data_handle); @@ -373,7 +373,7 @@ final class PhabricatorFile extends PhabricatorFileDAO } public static function hashFileContent($data) { - return PhabricatorHash::digest($data); + return sha1($data); } public function loadFileData() {