summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2012-04-13 23:01:37 +0200
committerArthur Schiwon <blizzz@owncloud.com>2012-04-13 23:02:42 +0200
commit74f0bebfc8e6bb8b547792e8c181f8da08e3bfa5 (patch)
treeabc625b3e215e931f011eea4ca1843503b89440c
parentb9bdad51658a81e044957d3c327aa3ff1cbad408 (diff)
downloadnextcloud-server-74f0bebfc8e6bb8b547792e8c181f8da08e3bfa5.tar.gz
nextcloud-server-74f0bebfc8e6bb8b547792e8c181f8da08e3bfa5.zip
don't fail on missing extension
-rw-r--r--lib/filesystemview.php6
1 files changed, 5 insertions, 1 deletions
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;