diff options
Diffstat (limited to 'lib/filesystem.php')
-rw-r--r-- | lib/filesystem.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php index 43d743b639d..337b0f1464b 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -150,7 +150,7 @@ class OC_Filesystem{ if(!$path){ $path='/'; } - if(substr($path,0,1)!=='/'){ + if($path[0]!=='/'){ $path='/'.$path; } $foundMountPoint=''; @@ -313,12 +313,12 @@ class OC_Filesystem{ * @param string mountpoint */ static public function mount($class,$arguments,$mountpoint){ + if($mountpoint[0]!='/'){ + $mountpoint='/'.$mountpoint; + } if(substr($mountpoint,-1)!=='/'){ $mountpoint=$mountpoint.'/'; } - if(substr($mountpoint,0,1)!=='/'){ - $mountpoint='/'.$mountpoint; - } self::$mounts[$mountpoint]=array('class'=>$class,'arguments'=>$arguments); } @@ -349,7 +349,7 @@ class OC_Filesystem{ * @return bool */ static public function isValidPath($path){ - if(substr($path,0,1)!=='/'){ + if(!$path || $path[0]!=='/'){ $path='/'.$path; } if(strstr($path,'/../') || strrchr($path, '/') === '/..' ){ |