diff options
Diffstat (limited to 'apps/files/ajax/newfile.php')
-rw-r--r-- | apps/files/ajax/newfile.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php index c162237fe92..159a8b5d7a3 100644 --- a/apps/files/ajax/newfile.php +++ b/apps/files/ajax/newfile.php @@ -3,9 +3,8 @@ // Init owncloud global $eventSource; -if(!OC_User::isLoggedIn()) { - exit; -} +\OCP\JSON::checkLoggedIn(); +\OCP\JSON::callCheck(); \OC::$server->getSession()->close(); @@ -17,8 +16,6 @@ $source = isset( $_REQUEST['source'] ) ? trim($_REQUEST['source'], '/\\') : ''; if($source) { $eventSource = \OC::$server->createEventSource(); -} else { - OC_JSON::callCheck(); } function progress($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) { @@ -81,7 +78,6 @@ if (!\OC\Files\Filesystem::file_exists($dir . '/')) { exit(); } -//TODO why is stripslashes used on foldername in newfolder.php but not here? $target = $dir.'/'.$filename; if (\OC\Files\Filesystem::file_exists($target)) { @@ -139,7 +135,7 @@ if($source) { } } } - $result=\OC\Files\Filesystem::file_put_contents($target, $sourceStream); + $result = \OC\Files\Filesystem::file_put_contents($target, $sourceStream); } if($result) { $meta = \OC\Files\Filesystem::getFileInfo($target); |