don't fail on missing extension

This commit is contained in:
Arthur Schiwon 2012-04-13 23:01:37 +02:00
parent b9bdad5165
commit 74f0bebfc8
1 changed files with 5 additions and 1 deletions

View File

@ -283,7 +283,11 @@ class OC_FilesystemView {
if(OC_Filesystem::isValidPath($path)){
$source=$this->fopen($path,'r');
if($source){
$extention=substr($path,strrpos($path,'.'));
$extention='';
$extOffset=strpos($path,'.');
if($extOffset !== false) {
$extention=substr($path,strrpos($path,'.'));
}
$tmpFile=OC_Helper::tmpFile($extention);
file_put_contents($tmpFile,$source);
return $tmpFile;