normalize path to avoid problems with trailing slashes, double-slashes, etc.

This commit is contained in:
Björn Schießle 2012-10-16 12:46:39 +02:00
parent 9faae4b71c
commit f06467b95b
1 changed files with 2 additions and 2 deletions

View File

@ -24,12 +24,12 @@ if (isset($_GET['token'])) {
if (isset($_GET['file']) || isset($_GET['dir'])) {
if (isset($_GET['dir'])) {
$type = 'folder';
$path = $_GET['dir'];
$path = OC_Filesystem::normalizePath($_GET['dir']);
$baseDir = $path;
$dir = $baseDir;
} else {
$type = 'file';
$path = $_GET['file'];
$path = OC_Filesystem::normalizePath($_GET['file']);
}
$uidOwner = substr($path, 1, strpos($path, '/', 1) - 1);
if (OCP\User::userExists($uidOwner)) {