Issue Bug Closed

#93012Email address are not wrapped in A tag if config.spamProtectEmailAddresses is set

Rémy DANIEL 12/07/20, 09:56 updated 10/04/22, 14:12

Description

When the config.spamProtectEmailAddresses is set, a mailto:xxx@yyy.zzz string passed through lib.parseFunc is transformed to a mailto link, with an href of the form “@javascript:linkTo_UnCryptMailto()@”.

Problem, the <a> tag is removed in the rendered html, only the xxx@yyy.zzz stays.

If I set config.spamProtectEmailAddresses to 0, the <a href="mailto:xxxyyy.zzz”>xxx@yyy.zzz@ is present in the rendered html.

When debugging, I found that the makelinks conf of lib.parseFunc works well, but just after, the tags.a conf triggers a TEXT cObj with the <a href="javascript:linkTo_UnCryptMailto()">xxxyyy.zzz as value, and typolink removes the javascript:@ href, for security reason (see ContentObjectRenderer->resolveMixedLinkParameter)

How to reproduce:

page = PAGE
page.config.disableAllHeaderCode = 1
page.config.spamProtectEmailAddresses = -3
page.10 = TEXT
page.10.value = mailto:xxx@yyy.zzz
page.10.stdWrap.parseFunc < lib.parseFunc

Reviews 2