[Pkg-owncloud-commits] [owncloud] 37/111: Files app backend now normalizes paths before rendering templates

David Prévot taffit at moszumanska.debian.org
Wed Nov 20 21:38:38 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 008c3b80d6cca6a15299afe01f150f075813df8c
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
---
 apps/files/ajax/list.php |    2 +-
 apps/files/index.php     |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index 350fc7f..0be38c3 100644
--- a/apps/files/ajax/list.php
+++ b/apps/files/ajax/list.php
@@ -10,7 +10,7 @@ OCP\JSON::checkLoggedIn();
 
 // Load the files
 $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
-
+$dir = \OC\Files\Filesystem::normalizePath($dir);
 if (!\OC\Files\Filesystem::is_dir($dir . '/')) {
 	header("HTTP/1.0 404 Not Found");
 	exit();
diff --git a/apps/files/index.php b/apps/files/index.php
index f0f95b3..9ae378d 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -36,6 +36,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() . '');
@@ -128,7 +129,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', $isCreatable);
 	$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