aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-01-24 15:29:22 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-01-24 15:29:22 +0100
commitdbb0d0407324830f4a7ff51781c535c1cb0d2a06 (patch)
tree4613244bc386b3e956063c00c543af88e5d16095
parent6ab95e8e33e5dee48291bb3f95a86af0be8c3e70 (diff)
downloadnextcloud-server-dbb0d0407324830f4a7ff51781c535c1cb0d2a06.tar.gz
nextcloud-server-dbb0d0407324830f4a7ff51781c535c1cb0d2a06.zip
restore file in the root folder if the origin folder is not writable
-rw-r--r--apps/files_trashbin/lib/trash.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php
index 0dad0590227..e81ba12758e 100644
--- a/apps/files_trashbin/lib/trash.php
+++ b/apps/files_trashbin/lib/trash.php
@@ -91,7 +91,9 @@ class Trashbin {
// if location no longer exists, restore file in the root directory
$location = $result[0]['location'];
- if ( $result[0]['location'] != '/' && !$view->is_dir('files'.$result[0]['location']) ) {
+ if ( $result[0]['location'] != '/' &&
+ (!$view->is_dir('files'.$result[0]['location']) ||
+ !$view->is_writable('files'.$result[0]['location'])) ) {
$location = '';
}
} else {