Skip to content

Commit

Permalink
[Security] Upgrading to ^2.2 (#677)
Browse files Browse the repository at this point in the history
* Upgrading to ^2.2

* Apply php-cs-fixer changes

---------

Co-authored-by: mattamon <mattamon@users.noreply.github.com>
  • Loading branch information
mattamon and mattamon committed Sep 2, 2024
1 parent dd2ad6a commit 28f6e32
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"cbschuld/browser.php": "^1.9.6",
"phpoffice/phpspreadsheet": "^1.24 || ^2.1",
"phpoffice/phpspreadsheet": "^1.24 || ^2.2",
"pimcore/pimcore": "~11.3.1",
"symfony/webpack-encore-bundle": "^1.13.2"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/DataObject/DataObjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static function (Task $task) {

try {
$this->getDataForObject($object, $objectFromVersion);
} catch(\Throwable $e) {
} catch (\Throwable $e) {
$object = $objectFromDatabase;
$this->getDataForObject($object, false);
}
Expand Down Expand Up @@ -1352,7 +1352,7 @@ public function saveAction(Request $request): JsonResponse
if ($request->get('data')) {
try {
$this->applyChanges($object, $this->decodeJson($request->get('data')));
} catch(\Throwable $e) {
} catch (\Throwable $e) {
$this->applyChanges($objectFromDatabase, $this->decodeJson($request->get('data')));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function doGetGridColumnConfig(Request $request, Config $config, bool $is
$setAsFavourite = $savedGridConfig->isSetAsFavourite();
$saveFilters = $savedGridConfig->isSaveFilters();

foreach($gridConfig['columns'] as &$column) {
foreach ($gridConfig['columns'] as &$column) {
if (array_key_exists('isOperator', $column) && $column['isOperator']) {
$colAttributes = &$column['fieldConfig']['attributes'];
SecurityHelper::convertHtmlSpecialCharsArrayKeys($colAttributes, ['label', 'attribute', 'param1']);
Expand Down Expand Up @@ -1184,7 +1184,7 @@ public function getExportJobsAction(Request $request, GridHelperService $gridHel
//prepare fields
$fieldnames = [];
$fields = json_decode($allParams['fields'][0], true);
foreach($fields as $field) {
foreach ($fields as $field) {
$fieldnames[] = $field['key'];
}
$allParams['fields'] = $fieldnames;
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/ElementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ public function getRequiresDependenciesAction(Request $request): JsonResponse
'requires' => [], // Initialize 'requires' as an empty array
];

if(count($elements) > 0) {
if (count($elements) > 0) {
$result = Model\Element\Service::getFilterRequiresForFrontend($elements);
$result['total'] = count($result['requires']);

Expand Down Expand Up @@ -765,7 +765,7 @@ public function getRequiredByDependenciesAction(Request $request): JsonResponse
'requiredBy' => [], // Initialize 'requiredBy' as an empty array
];

if(count($elements) > 0) {
if (count($elements) > 0) {
$result = Model\Element\Service::getFilterRequiredByPathForFrontend($elements);
$result['total'] = count($result['requiredBy']);

Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Admin/MiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function jsonTranslationsSystemAction(Request $request, TranslatorInterfa
public function scriptProxyAction(Request $request): Response
{
$storageFile = $request->get('storageFile');
if(!$storageFile) {
if (!$storageFile) {
throw new \InvalidArgumentException('The parameter storageFile is required');
}

Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Admin/TranslationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,10 @@ protected function getGridFilterCondition(Request $request, string $tableName, b
];
}

if(!empty($conditionFilters)) {
if (!empty($conditionFilters)) {
$conditions = [];
$params = [];
foreach($conditionFilters as $conditionFilter) {
foreach ($conditionFilters as $conditionFilter) {
$conditions[] = $conditionFilter['condition'];
$params[$conditionFilter['field']] = $conditionFilter['value'];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Helper/GridHelperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ public function prepareListingForGrid(array $requestParams, string $requestedLan
if (isset($requestParams['filter_by_object_type'])) {
if ($requestParams['filter_by_object_type'] === 'only_objects') {
$list->setObjectTypes([DataObject::OBJECT_TYPE_OBJECT]);
} elseif($requestParams['filter_by_object_type'] === 'only_variant_objects') {
} elseif ($requestParams['filter_by_object_type'] === 'only_variant_objects') {
$list->setObjectTypes([DataObject::OBJECT_TYPE_VARIANT]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/PreviewGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function getSitePreviewConfig(Concrete $object): array
$domains = $site->getDomains();
array_unshift($domains, $site->getMainDomain());

if(is_null($preSelectedSite) && in_array(Tool::getHostname(), $domains)) {
if (is_null($preSelectedSite) && in_array(Tool::getHostname(), $domains)) {
$preSelectedSite = $sitesOptions[$label];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/System/AdminConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function get(): array

// If the read target is settings-store and no data is found there,
// load the data from the container config
if(!$data && $loadType === $repository::LOCATION_SETTINGS_STORE) {
if (!$data && $loadType === $repository::LOCATION_SETTINGS_STORE) {
$containerConfig = \Pimcore::getContainer()->getParameter('pimcore_admin.config');
$data[self::BRANDING] = $containerConfig[self::BRANDING];
$data[self::ASSETS] = $containerConfig[self::ASSETS];
Expand Down

0 comments on commit 28f6e32

Please sign in to comment.