diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_archive/lib/storage.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/ftp.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/smb.php | 8 | ||||
-rw-r--r-- | apps/files_external/lib/swift.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/webdav.php | 4 | ||||
-rw-r--r-- | apps/user_ldap/lib_ldap.php | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/apps/files_archive/lib/storage.php b/apps/files_archive/lib/storage.php index b8f7d468385..86761663611 100644 --- a/apps/files_archive/lib/storage.php +++ b/apps/files_archive/lib/storage.php @@ -18,7 +18,7 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{ private static $rootView; private function stripPath($path){//files should never start with / - if(substr($path,0,1)=='/'){ + if(!$path || $path[0]=='/'){ $path=substr($path,1); } return $path; diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php index e9655ebf3a5..4d5ae670de5 100644 --- a/apps/files_external/lib/ftp.php +++ b/apps/files_external/lib/ftp.php @@ -21,7 +21,7 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{ $this->password=$params['password']; $this->secure=isset($params['secure'])?(bool)$params['secure']:false; $this->root=isset($params['root'])?$params['root']:'/'; - if(substr($this->root,0,1)!='/'){ + if(!$this->root || $this->root[0]!='/'){ $this->root='/'.$this->root; } 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)=='/'){ diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index e3ba9c240cf..58b95a6ae01 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -269,7 +269,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ $this->user=$params['user']; $this->root=isset($params['root'])?$params['root']:'/'; $this->secure=isset($params['secure'])?(bool)$params['secure']:true; - if(substr($this->root,0,1)!='/'){ + if(!$this->root || $this->root[0]!='/'){ $this->root='/'.$this->root; } $this->auth = new CF_Authentication($this->user, $this->token, null, $this->host); diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index 07c90d4878e..d136f04f3eb 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -25,7 +25,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ $this->password=$params['password']; $this->secure=isset($params['secure'])?(bool)$params['secure']:false; $this->root=isset($params['root'])?$params['root']:'/'; - if(substr($this->root,0,1)!='/'){ + if(!$this->root || $this->root[0]!='/'){ $this->root='/'.$this->root; } if(substr($this->root,-1,1)!='/'){ @@ -273,7 +273,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ } private function cleanPath($path){ - if(substr($path,0,1)=='/'){ + if(!$path || $path[0]=='/'){ return substr($path,1); }else{ return $path; diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php index 22d464b65a2..befdf267bcd 100644 --- a/apps/user_ldap/lib_ldap.php +++ b/apps/user_ldap/lib_ldap.php @@ -576,7 +576,7 @@ class OC_LDAP { static private function combineFilter($filters, $operator) { $combinedFilter = '('.$operator; foreach($filters as $filter) { - if(substr($filter,0,1) != '(') { + if($filter[0] != '(') { $filter = '('.$filter.')'; } $combinedFilter.=$filter; @@ -692,4 +692,4 @@ class OC_LDAP { return false; } - }
\ No newline at end of file + } |