Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: Report duplicated extra files in integrity check
The `array_diff` is not comparing the array keys. This means that an extra key with an expected hash will not be reported. Using `array_diff_assoc` will report such files.

For example, copying `status.php` to `status 2.php`, will only be reported with the new version.

Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge authored and backportbot[bot] committed Feb 26, 2025
commit fe56b3ccc29fa5604bc588e7838989eb0264dbbc
4 changes: 2 additions & 2 deletions lib/private/IntegrityCheck/Checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ private function verify(string $signaturePath, string $basePath, string $certifi

// Compare the list of files which are not identical
$currentInstanceHashes = $this->generateHashes($this->getFolderIterator($basePath), $basePath);
$differencesA = array_diff($expectedHashes, $currentInstanceHashes);
$differencesB = array_diff($currentInstanceHashes, $expectedHashes);
$differencesA = array_diff_assoc($expectedHashes, $currentInstanceHashes);
$differencesB = array_diff_assoc($currentInstanceHashes, $expectedHashes);
$differences = array_unique(array_merge($differencesA, $differencesB));
$differenceArray = [];
foreach ($differences as $filename => $hash) {
Expand Down
Loading