@@ -11,23 +11,23 @@ |
||
11 | 11 | |
12 | 12 | class CleanHtmlMiddleware extends AbstractMiddleware |
13 | 13 | { |
14 | - public function __construct(protected CleanHtmlService $cleanHtmlService) {} |
|
14 | + public function __construct(protected CleanHtmlService $cleanHtmlService) {} |
|
15 | 15 | |
16 | - /** |
|
17 | - * Clean the HTML output. |
|
18 | - */ |
|
19 | - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
20 | - { |
|
21 | - $response = $handler->handle($request); |
|
16 | + /** |
|
17 | + * Clean the HTML output. |
|
18 | + */ |
|
19 | + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
20 | + { |
|
21 | + $response = $handler->handle($request); |
|
22 | 22 | |
23 | - if ($this->responseIsAlterable($response) && ($GLOBALS['TSFE']->config['config']['sourceopt.']['enabled'] ?? false)) { |
|
24 | - $processedHtml = $this->cleanHtmlService->clean( |
|
25 | - (string) $response->getBody(), |
|
26 | - (array) $GLOBALS['TSFE']->config['config']['sourceopt.'] |
|
27 | - ); |
|
28 | - $response = $response->withBody($this->getStringStream($processedHtml)); |
|
29 | - } |
|
23 | + if ($this->responseIsAlterable($response) && ($GLOBALS['TSFE']->config['config']['sourceopt.']['enabled'] ?? false)) { |
|
24 | + $processedHtml = $this->cleanHtmlService->clean( |
|
25 | + (string) $response->getBody(), |
|
26 | + (array) $GLOBALS['TSFE']->config['config']['sourceopt.'] |
|
27 | + ); |
|
28 | + $response = $response->withBody($this->getStringStream($processedHtml)); |
|
29 | + } |
|
30 | 30 | |
31 | - return $response; |
|
32 | - } |
|
31 | + return $response; |
|
32 | + } |
|
33 | 33 | } |