]> source.dussan.org Git - nextcloud-server.git/commitdiff
calling OC_Filesystem at this point will initialize file system with wrong user ...
authorBjörn Schießle <schiessle@owncloud.com>
Wed, 24 Oct 2012 08:04:19 +0000 (10:04 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Wed, 24 Oct 2012 08:06:00 +0000 (10:06 +0200)
apps/files_sharing/public.php

index 59385dd6868564b0813f9d8392f898140bc3605d..ba3338febd78d8395708d24d1cdb5c04b499c27d 100644 (file)
@@ -24,12 +24,18 @@ if (isset($_GET['token'])) {
 if (isset($_GET['file']) || isset($_GET['dir'])) {
        if (isset($_GET['dir'])) {
                $type = 'folder';
-               $path = OC_Filesystem::normalizePath($_GET['dir']);
+               $path = $_GET['dir'];\r
+               if(strlen($path)>1 and substr($path,-1,1)==='/') {\r
+                       $path=substr($path,0,-1);\r
+               }
                $baseDir = $path;
                $dir = $baseDir;
        } else {
                $type = 'file';
-               $path = OC_Filesystem::normalizePath($_GET['file']);
+               $path = $_GET['dir'];\r
+               if(strlen($path)>1 and substr($path,-1,1)==='/') {\r
+                       $path=substr($path,0,-1);\r
+               }
        }
        $uidOwner = substr($path, 1, strpos($path, '/', 1) - 1);
        if (OCP\User::userExists($uidOwner)) {