-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/2.4-develop' into MC-32430
- Loading branch information
Showing
49 changed files
with
1,996 additions
and
1,021 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
34 changes: 17 additions & 17 deletions
34
app/code/Magento/Catalog/Model/Layout/DepersonalizePlugin.php
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 |
---|---|---|
@@ -1,55 +1,55 @@ | ||
<?php | ||
/** | ||
* Depersonalize catalog session data | ||
* | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\Catalog\Model\Layout; | ||
|
||
use Magento\Catalog\Model\Session as CatalogSession; | ||
use Magento\Framework\View\LayoutInterface; | ||
use Magento\PageCache\Model\DepersonalizeChecker; | ||
|
||
/** | ||
* Class DepersonalizePlugin | ||
* Depersonalize customer data. | ||
* | ||
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse) | ||
*/ | ||
class DepersonalizePlugin | ||
{ | ||
/** | ||
* @var DepersonalizeChecker | ||
*/ | ||
protected $depersonalizeChecker; | ||
private $depersonalizeChecker; | ||
|
||
/** | ||
* Catalog session | ||
* | ||
* @var \Magento\Catalog\Model\Session | ||
* @var CatalogSession | ||
*/ | ||
protected $catalogSession; | ||
private $catalogSession; | ||
|
||
/** | ||
* @param DepersonalizeChecker $depersonalizeChecker | ||
* @param \Magento\Catalog\Model\Session $catalogSession | ||
* @param CatalogSession $catalogSession | ||
*/ | ||
public function __construct( | ||
DepersonalizeChecker $depersonalizeChecker, | ||
\Magento\Catalog\Model\Session $catalogSession | ||
CatalogSession $catalogSession | ||
) { | ||
$this->catalogSession = $catalogSession; | ||
$this->depersonalizeChecker = $depersonalizeChecker; | ||
$this->catalogSession = $catalogSession; | ||
} | ||
|
||
/** | ||
* After generate Xml | ||
* Change sensitive customer data if the depersonalization is needed. | ||
* | ||
* @param \Magento\Framework\View\LayoutInterface $subject | ||
* @param \Magento\Framework\View\LayoutInterface $result | ||
* @return \Magento\Framework\View\LayoutInterface | ||
* @param LayoutInterface $subject | ||
* @return void | ||
*/ | ||
public function afterGenerateXml(\Magento\Framework\View\LayoutInterface $subject, $result) | ||
public function afterGenerateElements(LayoutInterface $subject) | ||
{ | ||
if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) { | ||
$this->catalogSession->clearStorage(); | ||
} | ||
return $result; | ||
} | ||
} |
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
Oops, something went wrong.