summaryrefslogtreecommitdiffstats
path: root/lib/filesystemview.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/filesystemview.php')
-rw-r--r--lib/filesystemview.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/filesystemview.php b/lib/filesystemview.php
index 9d530c7ad63..95873bd87cf 100644
--- a/lib/filesystemview.php
+++ b/lib/filesystemview.php
@@ -283,8 +283,12 @@ class OC_FilesystemView {
if(OC_Filesystem::isValidPath($path)){
$source=$this->fopen($path,'r');
if($source){
- $extention=substr($path,strrpos($path,'.'));
- $tmpFile=OC_Helper::tmpFile($extention);
+ $extension='';
+ $extOffset=strpos($path,'.');
+ if($extOffset !== false) {
+ $extension=substr($path,strrpos($path,'.'));
+ }
+ $tmpFile=OC_Helper::tmpFile($extension);
file_put_contents($tmpFile,$source);
return $tmpFile;
}