From 74f0bebfc8e6bb8b547792e8c181f8da08e3bfa5 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 13 Apr 2012 23:01:37 +0200 Subject: [PATCH] don't fail on missing extension --- lib/filesystemview.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/filesystemview.php b/lib/filesystemview.php index 9d530c7ad63..3045fc8b88c 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -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;