-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Security changes from upstream 2.4.7-p1
- Loading branch information
Showing
24 changed files
with
253 additions
and
528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
app/code/Magento/Customer/Plugin/Webapi/Controller/Rest/ValidateCustomerData.php
This file was deleted.
Oops, something went wrong.
132 changes: 0 additions & 132 deletions
132
...ode/Magento/Customer/Test/Unit/Plugin/Webapi/Controller/Rest/ValidateCustomerDataTest.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Quote\Plugin; | ||
|
||
use Magento\Framework\Exception\NoSuchEntityException; | ||
use Magento\Quote\Model\Quote; | ||
use Magento\Quote\Api\Data\AddressInterface; | ||
use Magento\Quote\Model\QuoteAddressValidator; | ||
|
||
/** | ||
* Quote address plugin | ||
*/ | ||
class QuoteAddress | ||
{ | ||
/** | ||
* @var QuoteAddressValidator | ||
*/ | ||
protected QuoteAddressValidator $addressValidator; | ||
|
||
/** | ||
* @param QuoteAddressValidator $addressValidator | ||
*/ | ||
public function __construct( | ||
QuoteAddressValidator $addressValidator | ||
) { | ||
$this->addressValidator = $addressValidator; | ||
} | ||
|
||
/** | ||
* Validate address before setting billing address | ||
* | ||
* @param Quote $subject | ||
* @param AddressInterface|null $address | ||
* @return array | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function beforeSetBillingAddress(Quote $subject, AddressInterface $address = null): array | ||
{ | ||
if ($address !== null) { | ||
$this->addressValidator->validateWithExistingAddress($subject, $address); | ||
} | ||
|
||
return [$address]; | ||
} | ||
|
||
/** | ||
* Validate address before setting shipping address | ||
* | ||
* @param Quote $subject | ||
* @param AddressInterface|null $address | ||
* @return array | ||
* @throws NoSuchEntityException | ||
*/ | ||
public function beforeSetShippingAddress(Quote $subject, AddressInterface $address = null): array | ||
{ | ||
if ($address !== null) { | ||
$this->addressValidator->validateWithExistingAddress($subject, $address); | ||
} | ||
|
||
return [$address]; | ||
} | ||
} |
Oops, something went wrong.