summaryrefslogtreecommitdiffstats
path: root/apps/files/ajax/newfile.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/ajax/newfile.php')
-rw-r--r--apps/files/ajax/newfile.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php
index ec5b716fb2a..1853098c507 100644
--- a/apps/files/ajax/newfile.php
+++ b/apps/files/ajax/newfile.php
@@ -64,6 +64,15 @@ if(strpos($filename, '/') !== false) {
exit();
}
+if (!\OC\Files\Filesystem::file_exists($dir . '/')) {
+ $result['data'] = array('message' => (string)$l10n->t(
+ 'The target folder has been moved or deleted.'),
+ 'code' => 'targetnotfound'
+ );
+ OCP\JSON::error($result);
+ exit();
+}
+
//TODO why is stripslashes used on foldername in newfolder.php but not here?
$target = $dir.'/'.$filename;