Skip to content

Commit

Permalink
テーマのzipファイル名がテーマ名と異なる場合に追加に失敗する (baserproject#3555)
Browse files Browse the repository at this point in the history
  • Loading branch information
seto1 authored Jun 30, 2024
1 parent 014a08e commit dc567b9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugins/baser-core/src/Service/ThemesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,11 @@ public function add(array $postData): string
}
$name = $postData['file']->getClientFileName();
$postData['file']->moveTo(TMP . $name);
$srcDirName = basename($name, '.zip');
$zip = new BcZip();
if (!$zip->extract(TMP . $name, TMP)) {
throw new BcException(__d('baser_core', 'アップロードしたZIPファイルの展開に失敗しました。'));
}

$srcDirName = $zip->topArchiveName;
$dstName = $srcName = Inflector::camelize($srcDirName);
if (preg_match('/^(.+?)([0-9]+)$/', $srcName, $matches)) {
$baseName = $matches[1];
Expand Down

0 comments on commit dc567b9

Please sign in to comment.