Skip to content

Commit 4f58221

Browse files
committed
MC-18719: private cookie version increments each post request
1 parent 53c9196 commit 4f58221

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

app/code/Magento/Customer/Block/SectionNamesProvider.php

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Magento\Customer\Block;
44

5-
use Magento\Framework\Config\DataInterface;
5+
use Magento\Customer\CustomerData\SectionPool;
66
use Magento\Framework\View\Element\Block\ArgumentInterface;
77

88
/**
@@ -11,17 +11,17 @@
1111
class SectionNamesProvider implements ArgumentInterface
1212
{
1313
/**
14-
* @var \Magento\Framework\Config\DataInterface
14+
* @var SectionPool
1515
*/
16-
private $sectionConfig;
16+
private $sectionPool;
1717

1818
/**
19-
* @param \Magento\Framework\Config\DataInterface $sectionConfig
19+
* @param SectionPool $sectionPool
2020
*/
2121
public function __construct(
22-
DataInterface $sectionConfig
22+
SectionPool $sectionPool
2323
) {
24-
$this->sectionConfig = $sectionConfig->get('sections');
24+
$this->sectionPool = $sectionPool;
2525
}
2626

2727
/**
@@ -31,17 +31,6 @@ public function __construct(
3131
*/
3232
public function getSectionNames()
3333
{
34-
$resultSectionNames = [];
35-
foreach ($this->sectionConfig as $sectionRule => $sectionNames) {
36-
if (is_array($sectionNames)) {
37-
$resultSectionNames = array_merge($resultSectionNames, $sectionNames);
38-
}
39-
}
40-
41-
if ($allNameIndex = array_search('*', $resultSectionNames, true)) {
42-
unset($resultSectionNames[$allNameIndex]);
43-
}
44-
45-
return array_values(array_unique($resultSectionNames));
34+
return $this->sectionPool->getSectionNames();
4635
}
4736
}

app/code/Magento/Customer/CustomerData/SectionPool.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ public function getSectionsData(array $sectionNames = null, $forceNewTimestamp =
6262
return $sectionsData;
6363
}
6464

65+
/**
66+
* Return array of section names.
67+
*
68+
* @return array
69+
*/
70+
public function getSectionNames()
71+
{
72+
return array_keys($this->sectionSourceMap);
73+
}
74+
6575
/**
6676
* Get section sources by section names
6777
*

0 commit comments

Comments
 (0)