No Code Attached Yet J4 Issue bug
avatar brawdon
brawdon
29 Aug 2018

Steps to reproduce the issue

Create an html email link with a CC address...

<a href="mailto:someone@yoursite.com?cc=someoneelse@theirsite.com, another@thatsite.com, me@mysite.com&bcc=lastperson@theirsite.com&subject=Big%20News">Email Us</a>

Expected result

Email link with recipient and CC recipient.

Actual result

Code saves properly, but JS spambot prevention seems to removes the CC address after the ampersand.

System information (as much as possible)

Joomla 3.8.11

Additional comments

avatar brawdon brawdon - open - 29 Aug 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Aug 2018
avatar mbabker mbabker - change - 29 Aug 2018
The description was changed
avatar mbabker mbabker - edited - 29 Aug 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 29 Aug 2018

Please ask help on the forums. This repository concerns in first Place Joomla-Core coding. For this Reason closing this Issue, thanks.

avatar franz-wohlkoenig franz-wohlkoenig - change - 29 Aug 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-08-29 15:51:45
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 29 Aug 2018
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 29 Aug 2018
avatar joomla-cms-bot
joomla-cms-bot - comment - 29 Aug 2018
avatar brawdon
brawdon - comment - 29 Aug 2018

This is not a Joomla bug? It appears to be a core issue to me.

avatar brianteeman
brianteeman - comment - 29 Aug 2018

Re-opened

avatar brianteeman brianteeman - change - 29 Aug 2018
Status Closed New
Closed_Date 2018-08-29 15:51:45
Closed_By joomla-cms-bot
avatar brianteeman brianteeman - reopen - 29 Aug 2018
avatar mbabker
mbabker - comment - 29 Aug 2018

There's a core bug. Add this to the unit test for the email cloaking plugin:

			array(
				'<a href="mailto:toto@toto.com?cc=joe@nowhere13.com&bcc=bobo@toto.com&subject=Big%20News">Click Here</a>',
				"<a href='mailto:toto@toto.com?cc=joe@nowhere13.com&bcc=bobo@toto.com&subject=Big%20News'>Click Here</a>",
				"<span id=\"cloak__HASH__\">JLIB_HTML_CLOAKING</span><script type='text/javascript'>
				document.getElementById('cloak__HASH__').innerHTML = '';
				var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
				var path = 'hr' + 'ef' + '=';
				var addy__HASH__ = 't&#111;t&#111;' + '&#64;';
				addy__HASH__ = addy__HASH__ + 't&#111;t&#111;' + '&#46;' + 'c&#111;m?cc=j&#111;&#101;';
				var addy_text__HASH__ = 'Cl&#105;ck H&#101;r&#101;';document.getElementById('cloak__HASH__').innerHTML += '<a ' + path + '\'' + prefix + ':' + addy__HASH__ + '\'>'+addy_text__HASH__+'<\/a>';
				</script>
				"
			),

(Note that the expected JS is actually what it's giving right now, not what it's supposed to be, but it is easier to show the failing test result with the HTML string)

The test fails...

1) PlgContentEmailcloakTest::testOnContentPrepareWithRowNoFinder with data set #16 ('<a href="mailto:toto@toto.com...re</a>', '<a href='mailto:toto@toto.com...re</a>', '<span id="cloak__HASH__">JLIB...>\n                            ')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'<a href='mailto:toto@toto.com?cc=joe'>Click Here</a>'
+'<a href='mailto:toto@toto.com?cc=joe@nowhere13.com&bcc=bobo@toto.com&subject=Big%20News'>Click Here</a>'

tests/unit/suites/plugins/content/emailcloak/PlgContentEmailcloakTest.php:420

Looking at the test cases, we only cover links with single email addresses in them, there's no coverage of links with multiple email addresses and given this test fails it probably means the cloaking mechanism was never designed to work in the first place with something that has multiple addresses.

avatar brianteeman
brianteeman - comment - 29 Aug 2018

Also see #19343

avatar mbabker
mbabker - comment - 29 Aug 2018

Similar bug, completely unrelated code paths (the email cloaking plugin doesn't invoke any of the methods mentioned in the other issue).

If I had to take a guess though, this line and this line basically confirm that our API only processes single email addresses in these helpers and that we're going to have to get smarter about processing strings with multiple addresses (in this case, the code is running Joomla\CMS\String\PunycodeHelper::emailToUtf8('<a href='mailto:toto@toto.com?cc=joe@nowhere13.com&bcc=bobo@toto.com&subject=Big%20News'>Click Here</a>') and we see how that's turning out).

avatar franz-wohlkoenig franz-wohlkoenig - change - 29 Aug 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 29 Aug 2018
Category com_mailto
avatar brianteeman brianteeman - change - 30 Aug 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 30 Aug 2018
avatar jwaisner jwaisner - change - 18 Mar 2020
Status Discussion Confirmed
Build master staging
avatar brianteeman
brianteeman - comment - 26 Aug 2022

Please retag as J4 Issue

avatar zero-24 zero-24 - change - 26 Aug 2022
Labels Added: No Code Attached Yet J4 Issue
Removed: J3 Issue ?
avatar zero-24 zero-24 - labeled - 26 Aug 2022
avatar zero-24 zero-24 - unlabeled - 26 Aug 2022
avatar Hackwar Hackwar - change - 18 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 18 Feb 2023

Add a Comment

Login with GitHub to post a comment