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
parent 0a82d2ea3a
commit 39fe43b914
No known key found for this signature in database
GPG key ID: E055D6A4D513575C

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 {