Normalize file name before existence check in scanner

The scanner would not find a NFD-encoded file name in an
existing file list that is normalized.

This normalizes the file name before scanning.

Fixes issues where scanning repeatedly would make NFD files flicker in
and out of existence in the file cache.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
pull/29794/head
Vincent Petry 2021-11-09 11:56:10 +07:00 committed by backportbot[bot]
parent 03ccb6a09f
commit 2e79444828
1 changed files with 1 additions and 0 deletions

@ -421,6 +421,7 @@ class Scanner extends BasicEmitter implements IScanner {
continue;
}
$file = $fileMeta['name'];
$file = trim(\OC\Files\Filesystem::normalizePath($file), '/');
$newChildNames[] = $file;
$child = $path ? $path . '/' . $file : $file;
try {