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

Commit

Permalink
Fix create_resource by detecting trailing slash to choose between fil…
Browse files Browse the repository at this point in the history
…e and folder.
  • Loading branch information
cdujeu committed Sep 3, 2016
1 parent f536008 commit 9955eda
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/src/plugins/access.fs/FsAccessDriver.php
Expand Up @@ -346,13 +346,17 @@ public function createResourceAction(ServerRequestInterface &$request, ResponseI
$newAction = "copy";
}
}else{
if(substr_compare($path, "/", strlen($path)-1, 1) === 0){
$qPath = $params["path"];
if(substr_compare($qPath, "/", strlen($qPath)-1, 1) === 0){
// Ends with slash => mkdir
$newAction = "mkdir";
$newVars["file"] = $notDecodedPath;
if(!empty($params["override"])) {
$newVars["ignore_exists"] = $params["override"];
}
if(!empty($params["recursive"])) {
$newVars["recursive"] = $params["recursive"];
}
}else{
$newAction = "mkfile";
$newVars["node"] = $notDecodedPath;
Expand Down Expand Up @@ -2129,8 +2133,11 @@ public function mkDir($parentNode, $newDirName, $ignoreExists = false, $createRe
}
throw new PydioException($mess[40]);
}
if (!file_exists($parentNode->getUrl())){
throw new PydioException($mess[103]." ".$parentNode->getPath());
}
if (!$this->isWriteable($parentNode)) {
throw new PydioException($mess[38]." $parentNode->getPath() ".$mess[99]);
throw new PydioException($mess[38]." ".$parentNode->getPath()." ".$mess[99]);
}

$dirMode = 0775;
Expand Down

0 comments on commit 9955eda

Please sign in to comment.