From 944d2da682b4b20a43233faab8d06691b1d7d928 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Tue, 18 Mar 2014 22:23:45 +0100 Subject: [PATCH] Fix PowerFS + Download All in minisite combination --- .../src/plugins/action.powerfs/class.PowerFSController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/plugins/action.powerfs/class.PowerFSController.php b/core/src/plugins/action.powerfs/class.PowerFSController.php index 8002d69ae3..7f99169735 100644 --- a/core/src/plugins/action.powerfs/class.PowerFSController.php +++ b/core/src/plugins/action.powerfs/class.PowerFSController.php @@ -138,6 +138,7 @@ public function switchAction($action, $httpVars, $fileVars) $replaceSearch = array($rootDir, "\\"); $replaceReplace = array("", "/"); foreach ($selection->getFiles() as $selectionFile) { + $baseFile = $selectionFile; $args[] = '"'.substr($selectionFile, strlen($dir)+($dir=="/"?0:1)).'"'; $selectionFile = fsAccessWrapper::getRealFSReference($urlBase.$selectionFile); $todo[] = ltrim(str_replace($replaceSearch, $replaceReplace, $selectionFile), "/"); @@ -147,6 +148,12 @@ public function switchAction($action, $httpVars, $fileVars) $todo[] = str_replace($replaceSearch, $replaceReplace, $name); } } + if(trim($baseFile, "/") == ""){ + // ROOT IS SELECTED, FIX IT + $args = array(basename($rootDir)); + $rootDir = dirname($rootDir); + break; + } } $cmdSeparator = ((PHP_OS == "WIN32" || PHP_OS == "WINNT" || PHP_OS == "Windows")? "&" : ";"); //$archiveName = SystemTextEncoding::fromUTF8($httpVars["archive_name"]);