Skip to content

Commit

Permalink
Fix crash in hash calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Shkiv committed Nov 6, 2024
1 parent e5d49e9 commit 640b6e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/applications/files/storage/PhabricatorFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ public static function hashFileContent($data) {
// it just means we'll store extra data when users upload duplicate files
// instead of being able to deduplicate it.

$hash = hash('sha256', $data, $raw_output = false);
$hash = hash('sha256', phutil_string_cast($data), $raw_output = false);
if ($hash === false) {
return null;
}
Expand Down

0 comments on commit 640b6e0

Please sign in to comment.