diff options
Diffstat (limited to 'lib/archive')
-rw-r--r-- | lib/archive/tar.php | 4 | ||||
-rw-r--r-- | lib/archive/zip.php | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/archive/tar.php b/lib/archive/tar.php index 4ff78779834..944a0ac4ba4 100644 --- a/lib/archive/tar.php +++ b/lib/archive/tar.php @@ -150,7 +150,7 @@ class OC_Archive_TAR extends OC_Archive{ $folderContent=array(); $pathLength=strlen($path); foreach($files as $file){ - if(substr($file,0,1)=='/'){ + if($file[0]=='/'){ $file=substr($file,1); } if(substr($file,0,$pathLength)==$path and $file!=$path){ @@ -241,7 +241,7 @@ class OC_Archive_TAR extends OC_Archive{ } } } - if(substr($path,0,1)!='/'){//not all programs agree on the use of a leading / + if($path[0]!='/'){//not all programs agree on the use of a leading / return $this->fileExists('/'.$path); }else{ return false; diff --git a/lib/archive/zip.php b/lib/archive/zip.php index 22ab48937eb..6631a649b16 100644 --- a/lib/archive/zip.php +++ b/lib/archive/zip.php @@ -191,7 +191,7 @@ class OC_Archive_ZIP extends OC_Archive{ } private function stripPath($path){ - if(substr($path,0,1)=='/'){ + if(!$path || $path[0]=='/'){ return substr($path,1); }else{ return $path; |