diff options
Diffstat (limited to 'apps/files/ajax/newfile.php')
-rwxr-xr-x[-rw-r--r--] | apps/files/ajax/newfile.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php index 472b577a32a..2712b54f063 100644..100755 --- a/apps/files/ajax/newfile.php +++ b/apps/files/ajax/newfile.php @@ -3,7 +3,7 @@ // Init owncloud -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get the params $dir = isset( $_POST['dir'] ) ? stripslashes($_POST['dir']) : ''; @@ -12,13 +12,13 @@ $content = isset( $_POST['content'] ) ? $_POST['content'] : ''; $source = isset( $_POST['source'] ) ? stripslashes($_POST['source']) : ''; if($filename == '') { - OC_JSON::error(array("data" => array( "message" => "Empty Filename" ))); + OCP\JSON::error(array("data" => array( "message" => "Empty Filename" ))); exit(); } if($source){ if(substr($source,0,8)!='https://' and substr($source,0,7)!='http://'){ - OC_JSON::error(array("data" => array( "message" => "Not a valid source" ))); + OCP\JSON::error(array("data" => array( "message" => "Not a valid source" ))); exit(); } $sourceStream=fopen($source,'rb'); @@ -26,10 +26,10 @@ if($source){ $result=OC_Filesystem::file_put_contents($target,$sourceStream); if($result){ $mime=OC_Filesystem::getMimetype($target); - OC_JSON::success(array("data" => array('mime'=>$mime))); + OCP\JSON::success(array("data" => array('mime'=>$mime))); exit(); }else{ - OC_JSON::error(array("data" => array( "message" => "Error while downloading ".$source. ' to '.$target ))); + OCP\JSON::error(array("data" => array( "message" => "Error while downloading ".$source. ' to '.$target ))); exit(); } } @@ -39,9 +39,9 @@ if(OC_Files::newFile($dir, $filename, 'file')) { if($content){ OC_Filesystem::file_put_contents($dir.'/'.$filename,$content); } - OC_JSON::success(array("data" => array('content'=>$content))); + OCP\JSON::success(array("data" => array('content'=>$content))); exit(); } -OC_JSON::error(array("data" => array( "message" => "Error when creating the file" ))); +OCP\JSON::error(array("data" => array( "message" => "Error when creating the file" ))); |