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>
This commit is contained in:
Vincent Petry 2021-11-09 11:56:10 +01:00 committed by backportbot[bot]
parent d9e25f5f32
commit 106950d493

View file

@ -420,6 +420,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 {