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 @@ -106,13 +106,14 @@ public function __construct($parameters) {
106106 * @return bool
107107 */
108108 protected function remove ($ path ) {
109- if ($ this ->is_dir ($ path )) {
110- return $ this ->rmdir ($ path );
111- } elseif ( $ this ->is_file ($ path )) {
112- return $ this ->unlink ($ path );
113- } else {
114- return false ;
109+ if ($ this ->file_exists ($ path )) {
110+ if ( $ this ->is_dir ($ path )) {
111+ return $ this ->rmdir ($ path );
112+ } elseif ( $ this ->is_file ($ path )) {
113+ return $ this -> unlink ( $ path );
114+ }
115115 }
116+ return false ;
116117 }
117118
118119 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