summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-05-05 16:47:23 +0200
committerRobin Appelman <icewind@owncloud.com>2012-05-05 16:49:48 +0200
commitd875191777188bde61804452c55964842fceb083 (patch)
tree092e0497d1ed39d96e646d725bb019c356a22982 /apps/files/ajax
parent4a7591d0ab5c255b64b01b827c53d3fa98887d8d (diff)
downloadnextcloud-server-d875191777188bde61804452c55964842fceb083.tar.gz
nextcloud-server-d875191777188bde61804452c55964842fceb083.zip
only emit the filesystem hooks once when creating a new file
Diffstat (limited to 'apps/files/ajax')
-rwxr-xr-xapps/files/ajax/newfile.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php
index 2712b54f063..316eac0562d 100755
--- a/apps/files/ajax/newfile.php
+++ b/apps/files/ajax/newfile.php
@@ -32,15 +32,16 @@ if($source){
OCP\JSON::error(array("data" => array( "message" => "Error while downloading ".$source. ' to '.$target )));
exit();
}
-}
-
-
-if(OC_Files::newFile($dir, $filename, 'file')) {
+}else{
if($content){
- OC_Filesystem::file_put_contents($dir.'/'.$filename,$content);
+ if(OC_Filesystem::file_put_contents($dir.'/'.$filename,$content)){
+ OCP\JSON::success(array("data" => array('content'=>$content)));
+ exit();
+ }
+ }elseif(OC_Files::newFile($dir, $filename, 'file')){
+ OCP\JSON::success(array("data" => array('content'=>$content)));
+ exit();
}
- OCP\JSON::success(array("data" => array('content'=>$content)));
- exit();
}