[Pkg-owncloud-commits] [owncloud] 11/83: Files app backend now normalizes paths before rendering templates
David Prévot
taffit at moszumanska.debian.org
Wed Dec 18 13:05:24 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch 5.0
in repository owncloud.
commit 42e553cdc0a1e9860963679a57677b4218448610
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Thu Nov 14 13:22:53 2013 +0100
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
---
apps/files/ajax/list.php | 1 +
apps/files/index.php | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index 878e4cb..d0f1f58 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 dd5ea44..2d1ae26 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);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list