Skip to content
Snippets Groups Projects
Commit df140e4c authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[BUGFIX] Prevent application type exception in ViewHelper

In case the "f:format.html" ViewHelper is called
in the install tool or via CLI, the request might
miss the application type attribute. This led to
an exception on checking the application type.

This is now fixed by checking the request before
calling the static ApplicationType check.

Resolves: #96788
Releases: main, 11.5
Change-Id: I1e48a3556d510d2af82d4f95828d44c182db0663
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73423


Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent 310d0f22
Branches
Tags
No related merge requests found
......@@ -111,7 +111,9 @@ class HtmlViewHelper extends AbstractViewHelper
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$parseFuncTSPath = $arguments['parseFuncTSPath'];
$isBackendRequest = ApplicationType::fromRequest($renderingContext->getRequest())->isBackend();
$request = $renderingContext->getRequest();
$isBackendRequest = $request->getAttribute('applicationType')
&& ApplicationType::fromRequest($request)->isBackend();
if ($isBackendRequest) {
self::simulateFrontendEnvironment();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment