-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathSidResolver.php
More file actions
49 lines (45 loc) · 1.21 KB
/
SidResolver.php
File metadata and controls
49 lines (45 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\PageBuilder\Plugin\Framework\Session;
/**
* Plugin for SID resolver.
*/
class SidResolver
{
/**
* @var \Magento\Framework\App\RequestInterface
*/
private $request;
/**
* @param \Magento\Framework\App\RequestInterface $request
*/
public function __construct(
\Magento\Framework\App\RequestInterface $request
) {
$this->request = $request;
}
/**
* Get Sid for pagebuilder preview
*
* @param \Magento\Framework\Session\SidResolver $subject
* @param string|null $result
* @param \Magento\Framework\Session\SessionManagerInterface $session
*
* @return string|null
*/
public function afterGetSid(
\Magento\Framework\Session\SidResolver $subject,
$result,
\Magento\Framework\Session\SessionManagerInterface $session
) {
if (strpos($this->request->getPathInfo(), '/pagebuilder/contenttype/preview') === 0) {
return $this->request->getQuery(
$subject->getSessionIdQueryParam($session)
);
}
return $result;
}
}