Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-03-02 23:33:17 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2015-03-02 23:33:17 +0300
commit345c527ed0fcee1de60f04a3eb2ac2db32076b5e (patch)
tree8a416c99874ecb829c5502848a9359c4b8def4bc /apps/files/ajax
parentacabd81f42457d1a4c9e12663e2c65bd558c1896 (diff)
remove $content parameter
Diffstat (limited to 'apps/files/ajax')
-rw-r--r--apps/files/ajax/newfile.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php
index ba54ca35f7c..062de5a2523 100644
--- a/apps/files/ajax/newfile.php
+++ b/apps/files/ajax/newfile.php
@@ -11,7 +11,6 @@ global $eventSource;
// Get the params
$dir = isset( $_REQUEST['dir'] ) ? '/'.trim((string)$_REQUEST['dir'], '/\\') : '';
$filename = isset( $_REQUEST['filename'] ) ? trim((string)$_REQUEST['filename'], '/\\') : '';
-$content = isset( $_REQUEST['content'] ) ? (string)$_REQUEST['content'] : '';
$l10n = \OC::$server->getL10N('files');
@@ -59,11 +58,9 @@ if (\OC\Files\Filesystem::file_exists($target)) {
}
$success = false;
-if (!$content) {
- $templateManager = OC_Helper::getFileTemplateManager();
- $mimeType = OC_Helper::getMimetypeDetector()->detectPath($target);
- $content = $templateManager->getTemplate($mimeType);
-}
+$templateManager = OC_Helper::getFileTemplateManager();
+$mimeType = OC_Helper::getMimetypeDetector()->detectPath($target);
+$content = $templateManager->getTemplate($mimeType);
if($content) {
$success = \OC\Files\Filesystem::file_put_contents($target, $content);
@@ -74,7 +71,7 @@ if($content) {
if($success) {
$meta = \OC\Files\Filesystem::getFileInfo($target);
OCP\JSON::success(array('data' => \OCA\Files\Helper::formatFileInfo($meta)));
- exit();
+ return;
}
OCP\JSON::error(array('data' => array( 'message' => $l10n->t('Error when creating the file') )));