Bug #98606
closedLink text in typoLink_PostProc hook
100%
Description
Use case¶
When using the typoLink_PostProc hook the typoscript setup "config.spamProtectEmailAddresses_atSubst = (at)" is not being respected. Instead of rendering "info(at)domain.ch" the plain email address "info@domain.ch" is rendered.
Findings¶
In case hook registrations exist the already processed link text (available in "$thislastTypoLinkResult->getLinkText()") is overwritten with the initial link text (that might get altered by a registered hook processor).
Updated by Gerrit Code Review about 2 years ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76110
Updated by Alex Kellner about 2 years ago
I can confirm this issue for TYPO3 11 while TYPO3 10 works as expected.
When registering a hook in ext_localconf.php (done in https://github.com/in2code-de/lux/blob/develop/ext_localconf.php#L49) like:
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typoLink_PostProc'][] = \In2code\Lux\Hooks\LuxLinkListenerLinkhandler::class . '->postProcessTypoLink';
Email rendering with spam rewrite is broken. Even if the target class and function will not manipulate $parameters or is simply empty.
How to reproduce
Example TypoScript:
config.spamProtectEmailAddresses = 10 config.spamProtectEmailAddresses_atSubst = @<span hidden>no spam</span>
Example Fluid rendering:
<f:link.email email="service@mail.org"/>
Simply register the hook in your sitepackage and let the target function empty.
Output:
// Expected <a href="#" data-mailto-token="wksvdy4sxpyJsx,myno8no" data-mailto-vector="10">info@<span hidden>no spam</span>mail.org</a> // Actual <a href="#" data-mailto-token="wksvdy4sxpyJsx,myno8no" data-mailto-vector="10">info@mail.org</a>
Related to LUX issue: https://github.com/in2code-de/lux/issues/31
Updated by Gerrit Code Review about 2 years ago
Patch set 2 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76110
Updated by Gerrit Code Review about 2 years ago
Patch set 3 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76110
Updated by Roman Büchler about 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b8e600235ecaec3653f4e9c4e3df9432766c5223.