diff options
Diffstat (limited to 'lib/private/Files/Storage/Local.php')
-rw-r--r-- | lib/private/Files/Storage/Local.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php index 909b124ff64..3d06ac0e206 100644 --- a/lib/private/Files/Storage/Local.php +++ b/lib/private/Files/Storage/Local.php @@ -95,7 +95,7 @@ class Local extends \OC\Files\Storage\Common { $this->config = \OC::$server->get(IConfig::class); $this->mimeTypeDetector = \OC::$server->get(IMimeTypeDetector::class); $this->defUMask = $this->config->getSystemValue('localstorage.umask', 0022); - $this->caseInsensitive = $this->config->getSystemValueBool('localstorage.case_insensitive', false); + $this->caseInsensitive = $arguments['case_insensitive'] ?? $this->config->getSystemValueBool('localstorage.case_insensitive', false); // support Write-Once-Read-Many file systems $this->unlinkOnTruncate = $this->config->getSystemValueBool('localstorage.unlink_on_truncate', false); @@ -281,6 +281,8 @@ class Local extends \OC\Files\Storage\Common { public function file_exists($path) { if ($this->caseInsensitive) { + // if the underlying filesystem is case-insensitive, we do our own case-sensitive + // comparison to ensure our `file_exists` implementation is always case-sensitive $fullPath = $this->getSourcePath($path); $parentPath = dirname($fullPath); if (!is_dir($parentPath)) { @@ -293,6 +295,11 @@ class Local extends \OC\Files\Storage\Common { } } + public function pathAvailable(string $path): bool { + // use the native file-exists even for case-insensitive filesystems + return !file_exists($this->getSourcePath($path)); + } + public function filemtime($path) { $fullPath = $this->getSourcePath($path); clearstatcache(true, $fullPath); |