diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-14 13:22:53 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-15 10:40:01 +0100 |
commit | 42e553cdc0a1e9860963679a57677b4218448610 (patch) | |
tree | f274f7ed735ba448b64da215b8b2ab9a2969498d | |
parent | e44831d10f47e409623f2213488cac72915ffb69 (diff) | |
download | nextcloud-server-42e553cdc0a1e9860963679a57677b4218448610.tar.gz nextcloud-server-42e553cdc0a1e9860963679a57677b4218448610.zip |
Files app backend now normalizes paths before rendering templates
Before rendering breadcrumbs or the file list, the paths are now
normalized. This prevents the UI to show "." breadcrumbs in case the
path contains sections with "/./"
Fixes #5848
Backport of 008c3b80d6cca6a15299afe01f150f075813df8c
-rw-r--r-- | apps/files/ajax/list.php | 1 | ||||
-rw-r--r-- | apps/files/index.php | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 878e4cb2159..d0f1f58f6e6 100644 --- a/apps/files/ajax/list.php +++ b/apps/files/ajax/list.php @@ -10,6 +10,7 @@ OCP\JSON::checkLoggedIn(); // Load the files $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; +$dir = \OC\Files\Filesystem::normalizePath($dir); $doBreadcrumb = isset( $_GET['breadcrumb'] ) ? true : false; $data = array(); diff --git a/apps/files/index.php b/apps/files/index.php index dd5ea445daf..2d1ae26bba2 100644 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -35,6 +35,7 @@ OCP\Util::addscript('files', 'filelist'); OCP\App::setActiveNavigationEntry('files_index'); // Load the files $dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : ''; +$dir = \OC\Files\Filesystem::normalizePath($dir); // Redirect if directory does not exist if (!\OC\Files\Filesystem::is_dir($dir . '/')) { header('Location: ' . OCP\Util::getScriptName() . ''); @@ -132,7 +133,7 @@ if ($needUpgrade) { $tmpl = new OCP\Template('files', 'index', 'user'); $tmpl->assign('fileList', $list->fetchPage()); $tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage()); - $tmpl->assign('dir', \OC\Files\Filesystem::normalizePath($dir)); + $tmpl->assign('dir', $dir); $tmpl->assign('isCreatable', \OC\Files\Filesystem::isCreatable($dir . '/')); $tmpl->assign('permissions', $permissions); $tmpl->assign('files', $files); |