[BUGFIX] Do not depend on global TSFE for link generation 36/59036/6
authorBenni Mack <benni@typo3.org>
Wed, 5 Dec 2018 10:41:42 +0000 (11:41 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Mon, 17 Dec 2018 12:22:06 +0000 (13:22 +0100)
commit280bbccb449f5ae7a407f67e4543f3389782997a
tree619474224d5d812652b842f7b6232d212b6ef8b5
parent8119b978b13240474f2a37ac9e3abf2ce87b4efe
[BUGFIX] Do not depend on global TSFE for link generation

Handing in the dependency of TSFE into
AbstractLinkBuilder allows to use a custom TSFE
object, when working within middlewares (e.g. Redirects)
thus, not depending on global state directly.

As a drive-by-fix, using AbstractTypolinkBuilder now does not
generate a global TSFE anymore, which can have ugly side-effects.

Tests are now simplified because the original constructor can be
called directly instead of relying on $GLOBALS[TSFE].

Resolves: #87143
Releases: master, 9.5
Change-Id: I77f2da501d1a78f0579626ebb50ef47a0026f1f7
Reviewed-on: https://review.typo3.org/59036
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Reviewed-by: Jörg Bösche <typo3@joergboesche.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Typolink/AbstractTypolinkBuilder.php
typo3/sysext/frontend/Tests/Unit/Typolink/AbstractTypolinkBuilderTest.php
typo3/sysext/redirects/Classes/Service/RedirectService.php