]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move writable check into local filestorage so shared files can be renamed
authorMichael Gapczynski <GapczynskiM@gmail.com>
Sun, 1 Apr 2012 17:30:41 +0000 (13:30 -0400)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Sun, 1 Apr 2012 17:30:41 +0000 (13:30 -0400)
lib/filestorage/local.php
lib/filesystemview.php

index 688501aee906ed23ade34222dd6b1b2778181586..bd757f52ce76725dbc9a99a5f188c72690836fd0 100644 (file)
@@ -86,6 +86,10 @@ class OC_Filestorage_Local extends OC_Filestorage{
                return $this->delTree($path);
        }
        public function rename($path1,$path2){
+               if (!$this->is_writable($path1)) {
+                       OC_Log::write('core','unable to rename, file is not writable : '.$path1,OC_Log::ERROR);
+                       return false;
+               }
                if(! $this->file_exists($path1)){
                        OC_Log::write('core','unable to rename, file does not exists : '.$path1,OC_Log::ERROR);
                        return false;
index a3736f1976c3e1311451c8ade801a334ec5afe40..9d530c7ad6343807fdf283d1d99556bd00655a57 100644 (file)
@@ -192,7 +192,7 @@ class OC_FilesystemView {
                return $this->basicOperation('unlink',$path,array('delete'));
        }
        public function rename($path1,$path2){
-               if(OC_FileProxy::runPreProxies('rename',$path1,$path2) and $this->is_writable($path1) and OC_Filesystem::isValidPath($path2)){
+               if(OC_FileProxy::runPreProxies('rename',$path1,$path2) and OC_Filesystem::isValidPath($path2)){
                        $run=true;
                        OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_rename, array( OC_Filesystem::signal_param_oldpath => $path1 , OC_Filesystem::signal_param_newpath=>$path2, OC_Filesystem::signal_param_run => &$run));
                        if($run){