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

Commit

Permalink
Fix PowerFS WinOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanomani committed Oct 6, 2016
1 parent 9ab1c80 commit fb1e6d0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/plugins/action.powerfs/PowerFSController.php
Expand Up @@ -116,7 +116,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
return;
}

$rootDir = FsAccessWrapper::getRealFSReference($urlBase) . $dir;
$rootDir = FsAccessWrapper::getRealFSReference($urlBase) . TextEncoder::toStorageEncoding($dir);
// List all files
$todo = array();
$args = array();
Expand All @@ -125,7 +125,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
foreach ($selection->getFiles() as $selectionFile) {
$selectionFile = TextEncoder::toStorageEncoding($selectionFile);
$baseFile = $selectionFile;
$args[] = escapeshellarg(substr($selectionFile, strlen($dir) + ($dir == "/" ? 0 : 1)));
$args[] = escapeshellarg(substr($selectionFile, strlen(TextEncoder::toStorageEncoding($dir)) + ($dir == "/" ? 0 : 1)));
$selectionFile = FsAccessWrapper::getRealFSReference($urlBase . $selectionFile);
$todo[] = ltrim(str_replace($replaceSearch, $replaceReplace, $selectionFile), "/");
if (is_dir($selectionFile)) {
Expand All @@ -136,8 +136,8 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
}
if (trim($baseFile, "/") == "") {
// ROOT IS SELECTED, FIX IT
$args = array(escapeshellarg(TextEncoder::toStorageEncoding(basename($rootDir))));
$rootDir = TextEncoder::toStorageEncoding(dirname($rootDir));
$args = array(escapeshellarg(basename($rootDir)));
$rootDir = dirname($rootDir);
break;
}
}
Expand All @@ -148,7 +148,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
$archiveName = ApplicationState::getTemporaryFolder() . DIRECTORY_SEPARATOR . $opeId . "_" . $archiveName;
}
chdir($rootDir);
$cmd = $this->getContextualOption($ctx, "ZIP_PATH") . " -r " . escapeshellarg($archiveName) . " " . implode(" ", $args);
$cmd = $this->getContextualOption($ctx, "ZIP_PATH") . " -r " . escapeshellarg(TextEncoder::toStorageEncoding($archiveName)) . " " . implode(" ", $args);
/** @var \Pydio\Access\Driver\StreamProvider\FS\FsAccessDriver $fsDriver */
$fsDriver = PluginsService::getInstance($ctx)->getUniqueActivePluginForType("access");
$c = $fsDriver->getConfigs();
Expand Down

0 comments on commit fb1e6d0

Please sign in to comment.