Skip to content

Commit 36d2838

Browse files
committed
Merge branch '5.x' into 6.x
2 parents 8a57590 + 8ba38ff commit 36d2838

13 files changed

Lines changed: 33 additions & 22 deletions

CHANGELOG.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
## Unreleased
44

55
- Improved product index performance by not eager-loading variants for table attributes that are already fetched via SQL joins. ([#4236](https://github.com/craftcms/commerce/issues/4236))
6-
- Fixed a bug where coupon codes would be automatically submitted too soon while entering them on order edit screens.
6+
- Fixed a bug where coupon codes were submitted too early while being entered on order edit screens.
7+
- Fixed a [high-severity](https://github.com/craftcms/cms/security/policy#severity--remediation) SQL injection vulnerability in the control panel. (GHSA-875v-7m49-8x88)
8+
- Fixed a [low-severity](https://github.com/craftcms/cms/security/policy#severity--remediation) Information disclosure vulnerability in payment controller action. (GHSA-3vxg-x5f8-f5qf)
79

810
## 5.5.4 - 2026-02-18
911

@@ -23,9 +25,9 @@
2325
- Fixed a SQL error that could occur when querying variants on PostgreSQL. ([#4210](https://github.com/craftcms/commerce/issues/4210))
2426
- Fixed an error that could occur when merging canonical product changes into a draft. ([#4199](https://github.com/craftcms/commerce/issues/4199))
2527
- Fixed a bug where variants weren’t being marked as modified when variants were added, deleted, or reordered. ([#4222](https://github.com/craftcms/commerce/pull/4222))
26-
- Fixed [high-severity](https://github.com/craftcms/cms/security/policy#severity--remediation) SQL injection vulnerabilities in the control panel. (GHSA-j3x5-mghf-xvfw, GHSA-pmgj-gmm4-jh6j)
27-
- Fixed a [high-severity](https://github.com/craftcms/cms/security/policy#severity--remediation) XSS vulnerability in the control panel. (GHSA-cfpv-rmpf-f624)
28-
- Fixed [low-severity](https://github.com/craftcms/cms/security/policy#severity--remediation) XSS vulnerabilities in the control panel. (GHSA-mqxf-2998-c6cp, GHSA-wj89-2385-gpx3, GHSA-mj32-r678-7mvp)
28+
- Fixed [high-severity](https://github.com/craftcms/cms/security/policy#severity--remediation) SQL injection vulnerabilities in the control panel. ([GHSA-j3x5-mghf-xvfw](https://github.com/craftcms/commerce/security/advisories/GHSA-j3x5-mghf-xvfw), [GHSA-pmgj-gmm4-jh6j](https://github.com/craftcms/commerce/security/advisories/GHSA-pmgj-gmm4-jh6j))
29+
- Fixed a [high-severity](https://github.com/craftcms/cms/security/policy#severity--remediation) XSS vulnerability in the control panel. ([GHSA-cfpv-rmpf-f624](https://github.com/craftcms/commerce/security/advisories/GHSA-cfpv-rmpf-f624))
30+
- Fixed [low-severity](https://github.com/craftcms/cms/security/policy#severity--remediation) XSS vulnerabilities in the control panel. ([GHSA-mqxf-2998-c6cp](https://github.com/craftcms/commerce/security/advisories/GHSA-mqxf-2998-c6cp), [GHSA-wj89-2385-gpx3](https://github.com/craftcms/commerce/security/advisories/GHSA-wj89-2385-gpx3), [GHSA-mj32-r678-7mvp](https://github.com/craftcms/commerce/security/advisories/GHSA-mj32-r678-7mvp))
2931

3032
## 5.5.2 - 2025-12-31
3133

src/controllers/FormulasController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
use Craft;
1111
use craft\commerce\Plugin;
12-
use craft\web\Controller;
1312
use yii\web\BadRequestHttpException;
1413
use yii\web\Response;
1514

@@ -19,7 +18,7 @@
1918
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
2019
* @since 2.2
2120
*/
22-
class FormulasController extends Controller
21+
class FormulasController extends BaseCpController
2322
{
2423
/**
2524
* @throws BadRequestHttpException

src/controllers/InventoryController.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
use craft\helpers\Cp;
2929
use craft\helpers\Html;
3030
use craft\web\assets\htmx\HtmxAsset;
31-
use craft\web\Controller;
3231
use craft\web\CpScreenResponseBehavior;
3332
use yii\base\InvalidConfigException;
3433
use yii\db\Exception;
@@ -43,12 +42,10 @@
4342
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
4443
* @since 5.0.0
4544
*/
46-
class InventoryController extends Controller
45+
class InventoryController extends BaseCpController
4746
{
4847
public $defaultAction = 'index';
4948

50-
protected array|int|bool $allowAnonymous = self::ALLOW_ANONYMOUS_NEVER;
51-
5249
/**
5350
* @param int|null $inventoryItemId
5451
* @param InventoryItem|null $inventoryItem
@@ -709,6 +706,8 @@ public function actionEditMovementModal(): Response
709706
*/
710707
public function actionUnfulfilledOrders(): Response
711708
{
709+
$this->requirePermission('commerce-manageInventoryStockLevels');
710+
712711
$view = Craft::$app->getView();
713712
$view->registerAssetBundle(InventoryAsset::class);
714713

src/controllers/InventoryLocationsController.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use craft\helpers\ArrayHelper;
2020
use craft\helpers\Cp;
2121
use craft\helpers\Html;
22-
use craft\web\Controller;
2322
use Throwable;
2423
use yii\base\InvalidConfigException;
2524
use yii\db\Exception;
@@ -34,10 +33,8 @@
3433
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
3534
* @since 5.0.0
3635
*/
37-
class InventoryLocationsController extends Controller
36+
class InventoryLocationsController extends BaseCpController
3837
{
39-
protected array|int|bool $allowAnonymous = self::ALLOW_ANONYMOUS_NEVER;
40-
4138
/**
4239
* @inheritdoc
4340
*/

src/controllers/PaymentsController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ public function actionPay(): ?Response
142142

143143
if (!$order->getIsActiveCart() && !$checkPaymentCanBeMade) {
144144
$error = Craft::t('commerce', 'Email required to make payments on a completed order.');
145-
return $this->asFailure($error, data: [
146-
$this->_cartVariableName => $this->cartArray($order),
147-
]);
145+
return $this->asFailure($error);
148146
}
149147

150148
if ($order->getStore()->getRequireShippingAddressAtCheckout() && !$order->shippingAddressId) {

src/controllers/ProductsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
2828
* @since 2.0
2929
*/
30-
class ProductsController extends BaseController
30+
class ProductsController extends BaseCpController
3131
{
3232
/**
3333
* @throws InvalidConfigException

src/controllers/SubscriptionsController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public function actionSave(): ?Response
140140
public function actionRefreshPayments(): Response
141141
{
142142
$this->requirePostRequest();
143+
$this->requirePermission('commerce-manageSubscriptions');
143144

144145
$subscriptionId = $this->request->getRequiredBodyParam('subscriptionId');
145146

src/controllers/VariantsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
1616
* @since 5.0.0
1717
*/
18-
class VariantsController extends BaseController
18+
class VariantsController extends BaseCpController
1919
{
2020
/**
2121
* @return Response

src/elements/Product.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,6 @@ public function getVariants(bool $includeDisabled = false): VariantCollection
12011201
* @throws InvalidConfigException
12021202
* @internal Do not use. Temporary method until we get a nested element manager provider in core.
12031203
*
1204-
* TODO: Remove this once we have a nested element manager provider interface in core.
12051204
*/
12061205
public function getAllVariants(): VariantCollection
12071206
{

src/services/Carts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function forgetCart(): void
279279
*/
280280
public function generateCartNumber(): string
281281
{
282-
return md5(uniqid((string)mt_rand(), true));
282+
return bin2hex(random_bytes(16));
283283
}
284284

285285
/**

0 commit comments

Comments
 (0)