Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit a66a1bb

Browse files
committed
Fix case sensitive rename
1 parent a0274d8 commit a66a1bb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

core/src/plugins/access.fs/FsAccessDriver.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use Psr\Http\Message\ServerRequestInterface;
3030
use Psr\Http\Message\UploadedFileInterface;
3131
use Pydio\Access\Core\AbstractAccessDriver;
32+
use Pydio\Access\Core\Exception\FileNotFoundException;
3233
use Pydio\Access\Core\Exception\FileNotWriteableException;
3334
use Pydio\Access\Core\MetaStreamWrapper;
3435
use Pydio\Access\Core\Model\AJXP_Node;
@@ -2079,6 +2080,10 @@ public function rename($originalNode, $dest = null, $filename_new = null)
20792080
throw new PydioException("$mess[37]");
20802081
}
20812082

2083+
if( !file_exists($originalNode->getUrl())){
2084+
throw new FileNotFoundException($originalNode->getPath());
2085+
}
2086+
20822087
if (!$this->isWriteable($originalNode)) {
20832088
throw new PydioException($mess[34]." ".$originalNode->getLabel()." ".$mess[99]);
20842089
}
@@ -2088,7 +2093,9 @@ public function rename($originalNode, $dest = null, $filename_new = null)
20882093
} else {
20892094
$newNode = $dest;
20902095
}
2091-
if (file_exists($newNode->getUrl())) {
2096+
2097+
$caseChange = ($newNode->getPath() !== $originalNode->getPath() && strtolower($newNode->getPath()) === strtolower($originalNode->getPath()));
2098+
if (!$caseChange && file_exists($newNode->getUrl())) {
20922099
throw new PydioException($newNode->getPath()." $mess[43]");
20932100
}
20942101
if (!file_exists($originalNode->getUrl())) {

0 commit comments

Comments
 (0)