Permalink
Browse files

Try fixing encoding issues on powerFS.

  • Loading branch information...
1 parent 17b764e commit 6066668c2de7b61fa825dd03ae12bad7af570546 @cdujeu cdujeu committed Sep 27, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 core/src/plugins/action.powerfs/PowerFSController.php
@@ -121,6 +121,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
$replaceSearch = array($rootDir, "\\");
$replaceReplace = array("", "/");
foreach ($selection->getFiles() as $selectionFile) {
+ $selectionFile = TextEncoder::toStorageEncoding($selectionFile);
$baseFile = $selectionFile;
$args[] = escapeshellarg(substr($selectionFile, strlen($dir) + ($dir == "/" ? 0 : 1)));
$selectionFile = FsAccessWrapper::getRealFSReference($urlBase . $selectionFile);
@@ -133,8 +134,8 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
}
if (trim($baseFile, "/") == "") {
// ROOT IS SELECTED, FIX IT
- $args = array(escapeshellarg(basename($rootDir)));
- $rootDir = dirname($rootDir);
+ $args = array(escapeshellarg(TextEncoder::toStorageEncoding(basename($rootDir))));
+ $rootDir = TextEncoder::toStorageEncoding(dirname($rootDir));
break;
}
}

5 comments on commit 6066668

@Nanomani
Contributor

this works well if I had in your code
after line 71 $dir = InputFilter::decodeSecureMagic($dir);
add this $dir = TextEncoder::toStorageEncoding($dir);

and

after line 147 $archiveName = ApplicationState::getAjxpTmpDir() . DIRECTORY_SEPARATOR . $opeId . "_" . $archiveName;
add this $archiveName = TextEncoder::toStorageEncoding($archiveName);

@Nanomani
Contributor
Nanomani commented on 6066668 Sep 27, 2016 edited

after more test. It is not perfect :-/
Menu "download" on selected file or folder works well
But not with the menu "Compress" => "file name with accent.zip" is stored with utf8 encoding

@Nanomani
Contributor
Nanomani commented on 6066668 Sep 28, 2016 edited

this commit fix all pb with encoding issue with "compress" and "download"

develop...Nanomani:PowerFS_fix_WinOS

@cdujeu
Member
cdujeu commented on 6066668 Sep 28, 2016

ok can you submit a PR ? Will be in 6.5.3 then, we are shipping 6.5.2 today

@Nanomani
Contributor

Done. Thx

Please sign in to comment.