forked from Intera/typo3-extension-cacheopt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Make TSFE retrieval more resilient
Always fetch the TypoScriptFrontendController from $GLOBALS['TYPO3_REQUEST']. This prevents issues with third party Extensions that call the ContentObjectRenderer before the request is initialized (e.g. ig_ldap_sso_auth).
- Loading branch information
Showing
3 changed files
with
31 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tx\Cacheopt\TagCollector; | ||
|
||
use Psr\Http\Message\ServerRequestInterface; | ||
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; | ||
|
||
abstract class AbstractTagCollector | ||
{ | ||
protected function getTypoScriptFrontendController(): ?TypoScriptFrontendController | ||
{ | ||
$typo3Request = $GLOBALS['TYPO3_REQUEST'] ?? null; | ||
|
||
if (!$typo3Request instanceof ServerRequestInterface) { | ||
return null; | ||
} | ||
|
||
$frontendController = $typo3Request->getAttribute('frontend.controller'); | ||
|
||
if (!$frontendController instanceof TypoScriptFrontendController) { | ||
return null; | ||
} | ||
|
||
return $frontendController; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters