Project

General

Profile

Actions

Feature #81939

open

Allow right click and copy for spam protected email addresses

Added by Neil Haskins over 7 years ago. Updated over 1 year ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2017-07-21
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Currently, if someone right clicks and copies a spam protected email address, they get javascript:linkTo_UnCryptMailto('sdfgserwhatevereteggh');
For email where the link text is not the address, I could see those who don't use an email client being unsure of how to get the address.

What I've experimented with is triggering a function on opening the context menu, to replace the href contents with the correct email.

Example here: https://jsfiddle.net/nhaskins/1nk7ky75/2/

I've tested this in TYPO3 by adding the following function to typo3/sysext/frontend/Classes/Page/PageGenerator.php at line 756 (end of $scriptJsCode)

function UnCryptMailto(el) {
    var str = el.getAttribute("href").split("\'")[1];
    el.setAttribute("href", decryptString(str,' . $tsfe->spamProtectEmailAddresses * -1 . '));
    el.removeAttribute("oncontextmenu");
}

and the following in typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php at line 5646 (just before $tagAttributes = [];)

if ($tsfe->spamProtectEmailAddresses) {
    $finalTagParts['aTagParams'] .= ' oncontextmenu="UnCryptMailto(this)"';
}

I'm pretty sure this isn't the best way to include the oncontextmenu attribute, and it looks like it would need to be added to at least the f:link.email viewhelper as well.


Related issues 2 (1 open1 closed)

Related to TYPO3 Core - Bug #101228: Mailto link decryption vs. manipulated DOMClosed2023-07-04

Actions
Related to TYPO3 Core - Story #94904: Is spamProtectEmailAddresses still worth keeping around?New2021-08-16

Actions
Actions #1

Updated by Riccardo De Contardi over 4 years ago

  • Category set to Frontend
Actions #2

Updated by Riccardo De Contardi over 4 years ago

As far as I have understood, this feature is covered by the third-party extensione emailobfuscator

https://extensions.typo3.org/extension/emailobfuscator

Actions #3

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/+/79068

Actions #4

Updated by Benni Mack over 1 year ago

  • Related to Bug #101228: Mailto link decryption vs. manipulated DOM added
Actions #5

Updated by Riccardo De Contardi 7 months ago

  • Related to Story #94904: Is spamProtectEmailAddresses still worth keeping around? added
Actions

Also available in: Atom PDF