]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed path normalization to prevent dot dirs
authorVincent Petry <pvince81@owncloud.com>
Wed, 20 Nov 2013 17:14:42 +0000 (18:14 +0100)
committerVincent Petry <pvince81@owncloud.com>
Thu, 21 Nov 2013 15:07:01 +0000 (16:07 +0100)
Fixes #5945 where stat(.) would cause the backend OC to cache a dot dir
(only in older versions)

apps/files_external/lib/webdav.php

index 9ee7f5552853c991539901520a26ac1cf71d8644..5857c59dcfc092ef7b72b1b8532b1560e3dc7cc7 100644 (file)
@@ -323,11 +323,9 @@ class DAV extends \OC\Files\Storage\Common{
        }
 
        public function cleanPath($path) {
-               if ( ! $path || $path[0]=='/') {
-                       return substr($path, 1);
-               } else {
-                       return $path;
-               }
+               $path = \OC\Files\Filesystem::normalizePath($path);
+               // remove leading slash
+               return substr($path, 1);
        }
 
        private function simpleResponse($method, $path, $body, $expected) {