Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2021-11-17 11:19:10 +0300
committerVincent Petry <vincent@nextcloud.com>2021-11-17 11:43:25 +0300
commitc92a0e415260dccb9092b9312ccd727de81bd0f7 (patch)
treee44c698206ca82b7091cf1c272e4e6132a6ac9f7 /lib/private/Files/Cache
parent67ebe75d0ee02977b95e43a31516d936d18514a2 (diff)
Normalize directory entries in Encoding wrapper
Directory entry file names are now normalized in getMetaData(), getDirectoryContents() and opendir(). This makes the scanner work properly as it assumes pre-normalized names. In case the names were not normalized, the scanner will now skip the entries and display a warning when applicable. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'lib/private/Files/Cache')
-rw-r--r--lib/private/Files/Cache/Scanner.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/Files/Cache/Scanner.php b/lib/private/Files/Cache/Scanner.php
index f31885d54a6..bdefca01f6f 100644
--- a/lib/private/Files/Cache/Scanner.php
+++ b/lib/private/Files/Cache/Scanner.php
@@ -422,9 +422,12 @@ class Scanner extends BasicEmitter implements IScanner {
}
$originalFile = $fileMeta['name'];
$file = trim(\OC\Files\Filesystem::normalizePath($originalFile), '/');
- if (trim($originalFile, '/') !== $file && !$this->storage->instanceOfStorage(Encoding::class)) {
+ if (trim($originalFile, '/') !== $file) {
// encoding mismatch, might require compatibility wrapper
+ \OC::$server->getLogger()->debug('Scanner: Skipping non-normalized file name "'. $originalFile . '" in path "' . $path . '".', ['app' => 'core']);
$this->emit('\OC\Files\Cache\Scanner', 'normalizedNameMismatch', [$path ? $path . '/' . $originalFile : $originalFile]);
+ // skip this entry
+ continue;
}
$newChildNames[] = $file;