aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib
diff options
context:
space:
mode:
authorPellaeon Lin <nfsmwlin@gmail.com>2014-01-30 22:50:20 +0800
committerPellaeon Lin <nfsmwlin@gmail.com>2014-01-30 22:50:20 +0800
commit099b71c712c38de7dac7e386252da02bb0cadf12 (patch)
tree84bcf83efdc4cc759a5ff184fa5148195abaab51 /apps/files/lib
parent929c930b0afd682bb98eb389d7ebad91bb34d643 (diff)
parent299a8285bd2601ccbac988b2e3e9b067d47921a2 (diff)
downloadnextcloud-server-099b71c712c38de7dac7e386252da02bb0cadf12.tar.gz
nextcloud-server-099b71c712c38de7dac7e386252da02bb0cadf12.zip
Merge branch 'master' into pr-exceed_upload_limit_msg
Conflicts: apps/files/templates/index.php apps/files_sharing/templates/public.php
Diffstat (limited to 'apps/files/lib')
-rw-r--r--apps/files/lib/app.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/files/lib/app.php b/apps/files/lib/app.php
index e04ac173d55..fea88faa92a 100644
--- a/apps/files/lib/app.php
+++ b/apps/files/lib/app.php
@@ -59,6 +59,13 @@ class App {
$result['data'] = array(
'message' => $this->l10n->t("Invalid folder name. Usage of 'Shared' is reserved.")
);
+ // rename to non-existing folder is denied
+ } else if (!$this->view->file_exists($dir)) {
+ $result['data'] = array('message' => (string)$this->l10n->t(
+ 'The target folder has been moved or deleted.',
+ array($dir)),
+ 'code' => 'targetnotfound'
+ );
// rename to existing file is denied
} else if ($this->view->file_exists($dir . '/' . $newname)) {
@@ -83,14 +90,17 @@ class App {
else {
$meta['type'] = 'file';
}
+ // these need to be set for determineIcon()
+ $meta['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($meta['mimetype']);
+ $meta['directory'] = $dir;
$fileinfo = array(
'id' => $meta['fileid'],
'mime' => $meta['mimetype'],
'size' => $meta['size'],
'etag' => $meta['etag'],
- 'directory' => $dir,
+ 'directory' => $meta['directory'],
'name' => $newname,
- 'isPreviewAvailable' => \OC::$server->getPreviewManager()->isMimeSupported($meta['mimetype']),
+ 'isPreviewAvailable' => $meta['isPreviewAvailable'],
'icon' => \OCA\Files\Helper::determineIcon($meta)
);
$result['success'] = true;