Project

General

Profile

Actions

Bug #98606

closed

Link text in typoLink_PostProc hook

Added by Roman Büchler over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
Start date:
2022-10-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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 "" 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).

Actions #1

Updated by Gerrit Code Review over 1 year 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

Actions #2

Updated by Alex Kellner over 1 year 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

Actions #3

Updated by Gerrit Code Review over 1 year 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

Actions #4

Updated by Gerrit Code Review over 1 year 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

Actions #5

Updated by Roman Büchler over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF