@@ -11,20 +11,20 @@ |
||
| 11 | 11 | |
| 12 | 12 | class RegExRepMiddleware extends AbstractMiddleware |
| 13 | 13 | { |
| 14 | - public function __construct(protected RegExRepService $regExRepService) {} |
|
| 14 | + public function __construct(protected RegExRepService $regExRepService) {} |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * RegEx search & replace @ HTML output. |
|
| 18 | - */ |
|
| 19 | - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
| 20 | - { |
|
| 21 | - $response = $handler->handle($request); |
|
| 16 | + /** |
|
| 17 | + * RegEx search & replace @ 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']['replacer.'] ?? false)) { |
|
| 24 | - $processedHtml = $this->regExRepService->process((string) $response->getBody()); |
|
| 25 | - $response = $response->withBody($this->getStringStream($processedHtml)); |
|
| 26 | - } |
|
| 23 | + if ($this->responseIsAlterable($response) && ($GLOBALS['TSFE']->config['config']['replacer.'] ?? false)) { |
|
| 24 | + $processedHtml = $this->regExRepService->process((string) $response->getBody()); |
|
| 25 | + $response = $response->withBody($this->getStringStream($processedHtml)); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - return $response; |
|
| 29 | - } |
|
| 28 | + return $response; |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -11,20 +11,20 @@ |
||
| 11 | 11 | |
| 12 | 12 | class SvgStoreMiddleware extends AbstractMiddleware |
| 13 | 13 | { |
| 14 | - public function __construct(protected SvgStoreService $svgStoreService) {} |
|
| 14 | + public function __construct(protected SvgStoreService $svgStoreService) {} |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * Search/Extract/Merge SVGs @ HTML output. |
|
| 18 | - */ |
|
| 19 | - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
| 20 | - { |
|
| 21 | - $response = $handler->handle($request); |
|
| 16 | + /** |
|
| 17 | + * Search/Extract/Merge SVGs @ 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']['svgstore.']['enabled'] ?? false)) { |
|
| 24 | - $processedHtml = $this->svgStoreService->process((string) $response->getBody()); |
|
| 25 | - $response = $response->withBody($this->getStringStream($processedHtml)); |
|
| 26 | - } |
|
| 23 | + if ($this->responseIsAlterable($response) && ($GLOBALS['TSFE']->config['config']['svgstore.']['enabled'] ?? false)) { |
|
| 24 | + $processedHtml = $this->svgStoreService->process((string) $response->getBody()); |
|
| 25 | + $response = $response->withBody($this->getStringStream($processedHtml)); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - return $response; |
|
| 29 | - } |
|
| 28 | + return $response; |
|
| 29 | + } |
|
| 30 | 30 | } |
@@ -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 | } |