summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/smb.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-06-08 21:23:25 +0200
committerBart Visscher <bartv@thisnet.nl>2012-06-08 21:38:10 +0200
commitac365121022f8b03ac47c41f8b3e32f9ba3f90e6 (patch)
tree6be1b33ec22dad1f74c46f97728362288176206b /apps/files_external/lib/smb.php
parentb9a152450837c90ab3463c0d00ff05219d4b875e (diff)
downloadnextcloud-server-ac365121022f8b03ac47c41f8b3e32f9ba3f90e6.tar.gz
nextcloud-server-ac365121022f8b03ac47c41f8b3e32f9ba3f90e6.zip
Don't use substr to get first char of string
Diffstat (limited to 'apps/files_external/lib/smb.php')
-rw-r--r--apps/files_external/lib/smb.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index f594fbb880d..9112655194a 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -23,13 +23,13 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
$this->password=$params['password'];
$this->share=$params['share'];
$this->root=isset($params['root'])?$params['root']:'/';
+ if(!$this->root || $this->root[0]!='/'){
+ $this->root='/'.$this->root;
+ }
if(substr($this->root,-1,1)!='/'){
$this->root.='/';
}
- if(substr($this->root,0,1)!='/'){
- $this->root='/'.$this->root;
- }
- if(substr($this->share,0,1)!='/'){
+ if(!$this->share || $this->share[0]!='/'){
$this->share='/'.$this->share;
}
if(substr($this->share,-1,1)=='/'){