Skip to content
Snippets Groups Projects
Commit 070fe024 authored by Björn Schießle's avatar Björn Schießle
Browse files

calling OC_Filesystem at this point will initialize file system with wrong...

calling OC_Filesystem at this point will initialize file system with wrong user (for public shared links if another user is logged in). Therefore remove trailing slashes without the help of OC_Filesystem.
parent a7eb56c7
No related branches found
No related tags found
No related merge requests found
......@@ -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'];
if(strlen($path)>1 and substr($path,-1,1)==='/') {
$path=substr($path,0,-1);
}
$baseDir = $path;
$dir = $baseDir;
} else {
$type = 'file';
$path = OC_Filesystem::normalizePath($_GET['file']);
$path = $_GET['dir'];
if(strlen($path)>1 and substr($path,-1,1)==='/') {
$path=substr($path,0,-1);
}
}
$uidOwner = substr($path, 1, strpos($path, '/', 1) - 1);
if (OCP\User::userExists($uidOwner)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment