From 8ab40f195984e76ec1fe8e89c8f0081f6bb7a418 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 14 Nov 2013 16:52:00 +0100 Subject: Removing trailing dot in path that samba doesn't seem to like Fixes #5778 Added unit test for getId() and constructUrl() --- apps/files_external/lib/smb.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'apps/files_external/lib') diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index ecd4dae0484..c464fa9107a 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -47,8 +47,13 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ public function constructUrl($path) { if (substr($path, -1)=='/') { - $path=substr($path, 0, -1); + $path = substr($path, 0, -1); } + if (substr($path, 0, 1)=='/') { + $path = substr($path, 1); + } + // remove trailing dots which some versions of samba don't seem to like + $path = rtrim($path, '.'); $path = urlencode($path); $user = urlencode($this->user); $pass = urlencode($this->password); -- cgit v1.2.3