[Pkg-owncloud-commits] [owncloud] 57/67: don't call OC_Filesystem::normalizePath() but simply remove trailing slashes. (OC_Filesystem::normalizePath() triggers some strange side effects)

David Prévot taffit at alioth.debian.org
Fri Nov 8 23:10:44 UTC 2013


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

taffit pushed a commit to annotated tag v4.5.1
in repository owncloud.

commit 2e5ce9f4ec1cde3d4853f2d502f3358705dc1ce5
Author: Björn Schießle <schiessle at owncloud.com>
Date:   Mon Oct 22 11:48:30 2012 +0200

    don't call OC_Filesystem::normalizePath() but simply remove trailing slashes.
    (OC_Filesystem::normalizePath() triggers some strange side effects)
---
 apps/files_sharing/public.php |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 5c0f37c..7e2da1b 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -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($stripTrailingSlash and 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['file'];
+		if($stripTrailingSlash and 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)) {

-- 
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