Permalink
Browse files

Fix PowerFS WinOS

  • Loading branch information...
1 parent 9ab1c80 commit fb1e6d04c3c308363e17a28f398f17f046b4308b @Nanomani Nanomani committed Oct 6, 2016
Showing with 5 additions and 5 deletions.
  1. +5 −5 core/src/plugins/action.powerfs/PowerFSController.php
@@ -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();
@@ -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)) {
@@ -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;
}
}
@@ -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();

0 comments on commit fb1e6d0

Please sign in to comment.