Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions controllers/admin/AdminPsThemeCustoAdvanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,14 @@ public function processCheckZipFormat($sZipPath)

for ($i = 0; $i < $oZip->numFiles; ++$i) {
$aZipElement = array_filter(explode('/', $oZip->getNameIndex($i)));
if (count($aZipElement) == 1) {
$aRootFilesAndFolders[] = $aZipElement[0];
if (empty($aZipElement)) {
continue;
}
// Collect the first path segment of every entry. The "config" folder may be present
// only implicitly (e.g. "config/theme.yml") when the archive carries no explicit
// directory entries, so relying on a standalone "config/" entry rejected otherwise
// valid zips with "The file is not valid.".
$aRootFilesAndFolders[] = reset($aZipElement);
}

$oZip->close();
Expand Down