summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-14 16:52:00 +0100
committerVincent Petry <pvince81@owncloud.com>2013-11-19 15:05:11 +0100
commit8ab40f195984e76ec1fe8e89c8f0081f6bb7a418 (patch)
treeea9c02b008cc4e558e25965d76c98b93b9095286 /apps/files_external/lib
parenta7962faa5621c5a52e4fab3a94eab0b5b975e742 (diff)
downloadnextcloud-server-8ab40f195984e76ec1fe8e89c8f0081f6bb7a418.tar.gz
nextcloud-server-8ab40f195984e76ec1fe8e89c8f0081f6bb7a418.zip
Removing trailing dot in path that samba doesn't seem to like
Fixes #5778 Added unit test for getId() and constructUrl()
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/smb.php7
1 files changed, 6 insertions, 1 deletions
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);