From d38c7a1688b3e5cdca0e27effd9be493d1de3605 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 28 Apr 2013 19:29:42 +0200 Subject: [PATCH] Also check if the source path is valid for rename and copy operations --- lib/filesystemview.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/filesystemview.php b/lib/filesystemview.php index ed52ba1be466..fb8d8dcc0d70 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -259,7 +259,9 @@ public function unlink($path){ public function rename($path1,$path2){ $absolutePath1=$this->getAbsolutePath($path1); $absolutePath2=$this->getAbsolutePath($path2); - if(OC_FileProxy::runPreProxies('rename',$absolutePath1,$absolutePath2) and OC_Filesystem::isValidPath($path2)){ + if(OC_FileProxy::runPreProxies('rename',$absolutePath1,$absolutePath2) + and OC_Filesystem::isValidPath($path1) + and OC_Filesystem::isValidPath($path2)){ $path1=$this->getRelativePath($absolutePath1); $path2=$this->getRelativePath($absolutePath2); if($path1==null or $path2==null){ @@ -290,7 +292,9 @@ public function rename($path1,$path2){ public function copy($path1,$path2){ $absolutePath1=$this->getAbsolutePath($path1); $absolutePath2=$this->getAbsolutePath($path2); - if(OC_FileProxy::runPreProxies('copy',$absolutePath1,$absolutePath2) and OC_Filesystem::isValidPath($path2)){ + if(OC_FileProxy::runPreProxies('copy',$absolutePath1,$absolutePath2) + and OC_Filesystem::isValidPath($path1) + and OC_Filesystem::isValidPath($path2)){ $path1=$this->getRelativePath($absolutePath1); $path2=$this->getRelativePath($absolutePath2); if($path1==null or $path2==null){