summaryrefslogtreecommitdiffstats
path: root/lib/filestorage
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-03-03 18:24:10 +0100
committerRobin Appelman <icewind@owncloud.com>2012-03-03 21:23:35 +0100
commitbb97cbbb0c7a58513e28d363c03ede4918034f21 (patch)
tree9c379c8cf037e5b0add4e0fcf01c909113c397be /lib/filestorage
parent0f540843058b869829a48f8d41abfff19b0862d4 (diff)
downloadnextcloud-server-bb97cbbb0c7a58513e28d363c03ede4918034f21.tar.gz
nextcloud-server-bb97cbbb0c7a58513e28d363c03ede4918034f21.zip
fix commong filestorage for files without extention
Diffstat (limited to 'lib/filestorage')
-rw-r--r--lib/filestorage/common.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/filestorage/common.php b/lib/filestorage/common.php
index ed12e67eeb3..f632474df01 100644
--- a/lib/filestorage/common.php
+++ b/lib/filestorage/common.php
@@ -99,7 +99,11 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
return false;
}
$head=fread($source,8192);//8kb should suffice to determine a mimetype
- $extention=substr($path,strrpos($path,'.'));
+ if($pos=strrpos($path,'.')){
+ $extention=substr($path,$pos);
+ }else{
+ $extention='';
+ }
$tmpFile=OC_Helper::tmpFile($extention);
file_put_contents($tmpFile,$head);
$mime=OC_Helper::getMimeType($tmpFile);
@@ -124,7 +128,11 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
if(!$source){
return false;
}
- $extention=substr($path,strrpos($path,'.'));
+ if($pos=strrpos($path,'.')){
+ $extention=substr($path,$pos);
+ }else{
+ $extention='';
+ }
$tmpFile=OC_Helper::tmpFile($extention);
$target=fopen($tmpFile,'w');
$count=OC_Helper::streamCopy($source,$target);