Permalink
Browse files

Fix create_resource by detecting trailing slash to choose between fil…

…e and folder.
  • Loading branch information...
1 parent f536008 commit 9955eda86910c3e0c79f4d8c0c64ba31ada7e71c @cdujeu cdujeu committed Sep 3, 2016
Showing with 9 additions and 2 deletions.
  1. +9 −2 core/src/plugins/access.fs/FsAccessDriver.php
@@ -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;
@@ -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;

0 comments on commit 9955eda

Please sign in to comment.