Skip to content

Commit d38c7a1

Browse files
committed
Also check if the source path is valid for rename and copy operations
1 parent 084448a commit d38c7a1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/filesystemview.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ public function unlink($path){
259259
public function rename($path1,$path2){
260260
$absolutePath1=$this->getAbsolutePath($path1);
261261
$absolutePath2=$this->getAbsolutePath($path2);
262-
if(OC_FileProxy::runPreProxies('rename',$absolutePath1,$absolutePath2) and OC_Filesystem::isValidPath($path2)){
262+
if(OC_FileProxy::runPreProxies('rename',$absolutePath1,$absolutePath2)
263+
and OC_Filesystem::isValidPath($path1)
264+
and OC_Filesystem::isValidPath($path2)){
263265
$path1=$this->getRelativePath($absolutePath1);
264266
$path2=$this->getRelativePath($absolutePath2);
265267
if($path1==null or $path2==null){
@@ -290,7 +292,9 @@ public function rename($path1,$path2){
290292
public function copy($path1,$path2){
291293
$absolutePath1=$this->getAbsolutePath($path1);
292294
$absolutePath2=$this->getAbsolutePath($path2);
293-
if(OC_FileProxy::runPreProxies('copy',$absolutePath1,$absolutePath2) and OC_Filesystem::isValidPath($path2)){
295+
if(OC_FileProxy::runPreProxies('copy',$absolutePath1,$absolutePath2)
296+
and OC_Filesystem::isValidPath($path1)
297+
and OC_Filesystem::isValidPath($path2)){
294298
$path1=$this->getRelativePath($absolutePath1);
295299
$path2=$this->getRelativePath($absolutePath2);
296300
if($path1==null or $path2==null){

0 commit comments

Comments
 (0)