diff --git a/core/src/plugins/cypher.encfs/class.EncfsMounter.php b/core/src/plugins/cypher.encfs/class.EncfsMounter.php index 6841f61944..1dd56db9e7 100644 --- a/core/src/plugins/cypher.encfs/class.EncfsMounter.php +++ b/core/src/plugins/cypher.encfs/class.EncfsMounter.php @@ -90,17 +90,18 @@ public function switchAction($actionName, $httpVars, $fileVars){ } //$repo = ConfService::getRepository(); - $dir = $this->getWorkingPath().ltrim(AJXP_Utils::decodeSecureMagic($httpVars["dir"]), "/"); + $workingP = rtrim($this->getWorkingPath(), "/"); + $dir = $workingP.AJXP_Utils::decodeSecureMagic($httpVars["dir"]); - if(dirname($dir) != rtrim($this->getWorkingPath(), "/")){ + if(dirname($dir) != $workingP){ throw new Exception("Please cypher only folders at the root of your repository"); } + $pass = $httpVars["pass"]; $raw = dirname($dir).DIRECTORY_SEPARATOR."ENCFS_RAW_".basename($dir); if(!strstr($dir, "ENCFS_CLEAR_") && !is_dir($raw)){ // NEW FOLDER SCENARIO $clear = dirname($dir).DIRECTORY_SEPARATOR."ENCFS_CLEAR_".basename($dir); - mkdir($raw); $result = self::initEncFolder($raw, $xmlTemplate, $this->getFilteredOption("ENCFS_XML_PASSWORD"), $pass); if($result){ @@ -248,4 +249,4 @@ public static function umountFolder($clear){ } if(!empty($error)) throw new Exception($error); } -} +} \ No newline at end of file