Skip to content

Commit

Permalink
Correctly handle plugin checksums with multiple md5 checksums for sin…
Browse files Browse the repository at this point in the history
…gle file.

Fixes #40.
  • Loading branch information
chesio committed Feb 23, 2018
1 parent 5d6b1b0 commit 35c80a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion classes/BlueChip/Security/Modules/Checksums/Verifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ protected static function checkDirectoryForModifiedFiles(string $path, $checksum
}

// Compare MD5 hashes.
if (md5_file($pathname) !== $checksum) {
// Note that there can be multiple checksums provided for a single file (at least in plugin checksums).
$md5 = md5_file($pathname);
if (is_array($checksum) ? !in_array($md5, $checksum, true) : ($md5 !== $checksum)) {
$modified_files[] = $filename;
}
}
Expand Down

0 comments on commit 35c80a9

Please sign in to comment.