diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-01-22 17:17:58 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-01-29 12:46:11 +0100 |
commit | 58c7042e708172b8e2fe252fc53abe87bcf8c1f1 (patch) | |
tree | 891abca5d6cf02a504fda3082203aa8a8cb3d53d /apps/files/ajax/newfolder.php | |
parent | a2b79ead2dad807779c51a32cf880fe0bd33d3bc (diff) | |
download | nextcloud-server-58c7042e708172b8e2fe252fc53abe87bcf8c1f1.tar.gz nextcloud-server-58c7042e708172b8e2fe252fc53abe87bcf8c1f1.zip |
Added error message for when target folder was removed
Whent trying to upload/rename/create files in a folder that was removed
or rename, the correct error message is now shown.
In the case of upload of multiple files, the upload is cancelled.
This situation can happen if the target folder was renamed or removed
from another browser window or client.
Diffstat (limited to 'apps/files/ajax/newfolder.php')
-rw-r--r-- | apps/files/ajax/newfolder.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/files/ajax/newfolder.php b/apps/files/ajax/newfolder.php index 2cbc8cfeba5..4cfcae3090d 100644 --- a/apps/files/ajax/newfolder.php +++ b/apps/files/ajax/newfolder.php @@ -29,6 +29,15 @@ if(strpos($foldername, '/') !== 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 here but not in newfile.php? $target = $dir . '/' . stripslashes($foldername); |