File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
lib/private/Files/Storage Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -108,13 +108,14 @@ public function __construct($parameters) {
108108 * @return bool
109109 */
110110 protected function remove ($ path ) {
111- if ($ this ->is_dir ($ path )) {
112- return $ this ->rmdir ($ path );
113- } elseif ( $ this ->is_file ($ path )) {
114- return $ this ->unlink ($ path );
115- } else {
116- return false ;
111+ if ($ this ->file_exists ($ path )) {
112+ if ( $ this ->is_dir ($ path )) {
113+ return $ this ->rmdir ($ path );
114+ } elseif ( $ this ->is_file ($ path )) {
115+ return $ this -> unlink ( $ path );
116+ }
117117 }
118+ return false ;
118119 }
119120
120121 public function is_dir ($ path ) {
Original file line number Diff line number Diff line change @@ -380,10 +380,12 @@ public function rename($source, $target): bool {
380380 return false ;
381381 }
382382
383- if ($ this ->is_dir ($ target )) {
384- $ this ->rmdir ($ target );
385- } elseif ($ this ->is_file ($ target )) {
386- $ this ->unlink ($ target );
383+ if ($ this ->file_exists ($ target )) {
384+ if ($ this ->is_dir ($ target )) {
385+ $ this ->rmdir ($ target );
386+ } elseif ($ this ->is_file ($ target )) {
387+ $ this ->unlink ($ target );
388+ }
387389 }
388390
389391 if ($ this ->is_dir ($ source )) {
You can’t perform that action at this time.
0 commit comments