Completed
Branch BUG/plugin-editor-session-fail (fb8dd9)
by
unknown
38:28 queued 24:28
created

DetectFileEditorRequest::isFileEditorRequest()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\core\services\request\middleware;
4
5
use EventEspresso\core\services\request\RequestInterface;
6
use EventEspresso\core\services\request\ResponseInterface;
7
8
/**
9
 * Class DetectFileEditorRequest
10
 * Detects File Editor requests and executes any logic needing set on those requests.
11
 * ported over from /core/middleware/EE_Detect_File_Editor_Request.core.php
12
 *
13
 * @package EventEspresso\core\services\request\middleware
14
 * @author  Darren Ethier
15
 * @since   4.9.59.p
16
 */
17
class DetectFileEditorRequest extends Middleware
18
{
19
20
    /**
21
     * converts a Request to a Response
22
     *
23
     * @param RequestInterface  $request
24
     * @param ResponseInterface $response
25
     * @return ResponseInterface
26
     */
27
    public function handleRequest(RequestInterface $request, ResponseInterface $response)
28
    {
29
        $this->request  = $request;
30
        $this->response = $response;
31
        if ($this->request->isWordPressScrape()) {
32
            add_filter('FHEE_load_EE_Session', '__return_false', 999);
33
        }
34
        $this->response = $this->processRequestStack($this->request, $this->response);
35
        return $this->response;
36
    }
37
}
38