mirror of
https://github.com/nextcloud/server.git
synced 2026-04-05 17:16:55 -04:00
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 <louis@chmn.me>
This commit is contained in:
parent
3b49ee1c6b
commit
fe56b3ccc2
1 changed files with 2 additions and 2 deletions
|
|
@ -335,8 +335,8 @@ class Checker {
|
|||
|
||||
// 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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue