From dbb0d0407324830f4a7ff51781c535c1cb0d2a06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Schie=C3=9Fle?= Date: Thu, 24 Jan 2013 15:29:22 +0100 Subject: [PATCH] restore file in the root folder if the origin folder is not writable --- apps/files_trashbin/lib/trash.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { -- 2.39.5