Skip to content

Commit 10be834

Browse files
committed
Merge remote-tracking branch 'upstream/4.3' into dependabot/composer/knplabs/knp-paginator-bundle-6.8.0
2 parents 4946e51 + 8f699d1 commit 10be834

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

src/Eccube/Command/PluginGenerateCommand.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
118118
$this->createTwigBlock($pluginDir, $code);
119119
$this->createConfigController($pluginDir, $code);
120120
$this->createGithubActions($pluginDir);
121+
$this->createGitattributes($pluginDir);
121122

122123
$this->io->success(sprintf('Plugin was successfully created: %s %s %s', $name, $code, $version));
123124

@@ -209,19 +210,13 @@ protected function createGithubActions($pluginDir)
209210
jobs:
210211
deploy:
211212
name: Build
212-
runs-on: ubuntu-22.04
213+
runs-on: ubuntu-latest
213214
steps:
214215
- name: Checkout
215216
uses: actions/checkout@v2
216217
- name: Packaging
217-
working-directory: ../
218218
run: |
219-
rm -rf $GITHUB_WORKSPACE/.github
220-
find $GITHUB_WORKSPACE -name "dummy" -delete
221-
find $GITHUB_WORKSPACE -name ".git*" -and ! -name ".gitkeep" -print0 | xargs -0 rm -rf
222-
chmod -R o+w $GITHUB_WORKSPACE
223-
cd $GITHUB_WORKSPACE
224-
tar cvzf ../${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.tar.gz ./*
219+
git archive HEAD --format=tar.gz > ../${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.tar.gz
225220
- name: Upload binaries to release of TGZ
226221
uses: svenstaro/upload-release-action@v1-release
227222
with:
@@ -235,6 +230,18 @@ protected function createGithubActions($pluginDir)
235230
$this->fs->dumpFile($pluginDir.'/.github/workflows/release.yml', $source);
236231
}
237232

233+
protected function createGitattributes($pluginDir)
234+
{
235+
$source = <<<EOL
236+
/.gitattributes export-ignore
237+
/.github export-ignore
238+
/.gitignore export-ignore
239+
/dummy export-ignore
240+
EOL;
241+
242+
$this->fs->dumpFile($pluginDir.'/.gitattributes', $source);
243+
}
244+
238245
/**
239246
* @param string $pluginDir
240247
*/

src/Eccube/Controller/Admin/Product/CsvImportController.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
use Eccube\Stream\Filter\SjisToUtf8EncodingFilter;
4444
use Eccube\Util\CacheUtil;
4545
use Eccube\Util\StringUtil;
46+
use HTMLPurifier;
4647
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
4748
use Symfony\Component\Filesystem\Filesystem;
4849
use Symfony\Component\Finder\Finder;
@@ -127,6 +128,8 @@ class CsvImportController extends AbstractCsvImportController
127128

128129
protected $currentLineNo = 1;
129130

131+
private HTMLPurifier $purifier;
132+
130133
/**
131134
* CsvImportController constructor.
132135
*
@@ -142,7 +145,7 @@ class CsvImportController extends AbstractCsvImportController
142145
* @param TaxRuleRepository $taxRuleRepository
143146
* @param BaseInfoRepository $baseInfoRepository
144147
* @param ValidatorInterface $validator
145-
*
148+
* @param HTMLPurifier $purifier
146149
* @throws \Exception
147150
*/
148151
public function __construct(
@@ -157,7 +160,8 @@ public function __construct(
157160
ProductRepository $productRepository,
158161
TaxRuleRepository $taxRuleRepository,
159162
BaseInfoRepository $baseInfoRepository,
160-
ValidatorInterface $validator
163+
ValidatorInterface $validator,
164+
HTMLPurifier $purifier
161165
) {
162166
$this->deliveryDurationRepository = $deliveryDurationRepository;
163167
$this->saleTypeRepository = $saleTypeRepository;
@@ -171,6 +175,7 @@ public function __construct(
171175
$this->taxRuleRepository = $taxRuleRepository;
172176
$this->BaseInfo = $baseInfoRepository->get();
173177
$this->validator = $validator;
178+
$this->purifier = $purifier;
174179
}
175180

176181
/**
@@ -319,7 +324,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil)
319324

320325
if (isset($row[$headerByKey['description_list']])) {
321326
if (StringUtil::isNotBlank($row[$headerByKey['description_list']])) {
322-
$Product->setDescriptionList(StringUtil::trimAll($row[$headerByKey['description_list']]));
327+
$Product->setDescriptionList($this->purifier->purify(StringUtil::trimAll($row[$headerByKey['description_list']])));
323328
} else {
324329
$Product->setDescriptionList(null);
325330
}
@@ -337,7 +342,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil)
337342

338343
return $this->renderWithError($form, $headers);
339344
} else {
340-
$Product->setDescriptionDetail(StringUtil::trimAll($row[$headerByKey['description_detail']]));
345+
$Product->setDescriptionDetail($this->purifier->purify(StringUtil::trimAll($row[$headerByKey['description_detail']])));
341346
}
342347
} else {
343348
$Product->setDescriptionDetail(null);
@@ -354,7 +359,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil)
354359

355360
if (isset($row[$headerByKey['free_area']])) {
356361
if (StringUtil::isNotBlank($row[$headerByKey['free_area']])) {
357-
$Product->setFreeArea(StringUtil::trimAll($row[$headerByKey['free_area']]));
362+
$Product->setFreeArea($this->purifier->purify(StringUtil::trimAll($row[$headerByKey['free_area']])));
358363
} else {
359364
$Product->setFreeArea(null);
360365
}
@@ -796,7 +801,7 @@ public function csvCategory(Request $request, CacheUtil $cacheUtil)
796801
$ParentCategory = null;
797802
if (isset($row[$headerByKey['parent_category_id']]) && StringUtil::isNotBlank($row[$headerByKey['parent_category_id']])) {
798803
if (!preg_match('/^\d+$/', $row[$headerByKey['parent_category_id']])) {
799-
$this->addErrors(($data->key() + 1).'行目の親カテゴリIDが存在しません');
804+
$this->addErrors(($data->key() + 1).'行目の親カテゴリIDは数字で入力してください');
800805

801806
return $this->renderWithError($form, $headers);
802807
}

src/Eccube/Resource/locale/messages.ja.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ admin.product.category_csv.category_id_description: 新規登録の場合は空
774774
admin.product.category_csv.category_name_col: カテゴリ名
775775
admin.product.category_csv.category_name_description: ""
776776
admin.product.category_csv.parent_category_id_col: 親カテゴリID
777-
admin.product.category_csv.parent_category_id_description: ""
777+
admin.product.category_csv.parent_category_id_description: 登録済みのカテゴリIDを数字で指定してください
778778
admin.product.category_csv.delete_flag_col: カテゴリ削除フラグ
779779
admin.product.category_csv.delete_flag_description: 0:登録 1:削除を指定します。未指定の場合、0として扱います。
780780

0 commit comments

Comments
 (0)