No Code Attached Yet
avatar ReLater
ReLater
15 Dec 2022

Steps to reproduce the issue

Joomla 4.2.5 and 4.2.6

  • Check that plugin "Content - Email Cloaking" is enabled and setting "Mode" is "As linkable mailto address" (= standard setting).
  • Open an article.
  • Switch editor to HTML-Code view.
  • Paste <p>info@example.com</p>.

grafik

  • Save article without switching back to normal view.
  • Open article in front-end.

Expected result

  • With JS enabled in browser

grafik

  • With JS disabled in browser

grafik

Actual result

Joomla 4.2.6

  • With JS enabled or disabled

grafik

Additional comments

There are other scenarios where cloaking doesn't work anymore like in 4.2.5.

Only if there's already a mailto link set in editor it looks like cloaking works.

From German forum: A user reports that <a href="#">info@example.com</a> isn't cloaked in their case. In a mod_custom module with "Prepare Content" activated.

avatar ReLater ReLater - open - 15 Dec 2022
avatar joomla-cms-bot joomla-cms-bot - change - 15 Dec 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Dec 2022
avatar ReLater ReLater - change - 15 Dec 2022
Title
[4.2.6] Email cloaking not always.
[4.2.6] Email cloaking fails.
avatar ReLater ReLater - edited - 15 Dec 2022
avatar ReLater ReLater - change - 15 Dec 2022
The description was changed
avatar ReLater ReLater - edited - 15 Dec 2022
avatar brianteeman
brianteeman - comment - 15 Dec 2022

What mode is the Email Cloaking plugin set to?

avatar ReLater
ReLater - comment - 15 Dec 2022

What mode is the Email Cloaking plugin set to?

Standard: "Add mailto".

I've tested it now on 3 sites (several will follow). Replacing plugins/content/emailcloak folder with 4.2.5 variant brings back cloaked emails on all concerned pages, like it was before update to 4.2.6 (that removed cloaking and click functionality).

Exchanging JavaScripts was not needed in my case (because I never use specific CSS classes or so), but blank email addresses. See: #36269

avatar brianteeman
brianteeman - comment - 15 Dec 2022

What mode is the Email Cloaking plugin set to?

Standard: "Add mailto".

Thanks for confirming

avatar ReLater ReLater - change - 15 Dec 2022
The description was changed
avatar ReLater ReLater - edited - 15 Dec 2022
avatar ReLater ReLater - change - 15 Dec 2022
The description was changed
avatar ReLater ReLater - edited - 15 Dec 2022
avatar ReLater
ReLater - comment - 15 Dec 2022

@LukasHH Could you please look at this issue?

avatar ReLater ReLater - change - 15 Dec 2022
The description was changed
avatar ReLater ReLater - edited - 15 Dec 2022
avatar bembelimen bembelimen - change - 15 Dec 2022
Labels Added: Release Blocker
avatar bembelimen bembelimen - labeled - 15 Dec 2022
avatar ReLater
ReLater - comment - 15 Dec 2022

Both email examples in opener post fail with $pattern

$pattern = '~<[^<]*(?<!\/)>(*SKIP)(*F)|(<\w.*\"' . $searchEmail . '\".*\/\>)~i';

4.2.5 was

$pattern = '~<[^<]*>(*SKIP)(*F)|' . $searchEmail . '~i';

avatar LukasHH
LukasHH - comment - 15 Dec 2022

I need to take another look at why I had changed the pattern.
I think that it was not recognized correctly when an email it is entered as a placeholder or title attribute.

Example:
<img src="/images/joomla_black.png" alt="" class="img-thumbnail" style="border: 1px solid #00f;" title="email@example.org" />

and

<input type="text" placeholder="email@example.org" />

avatar LukasHH
LukasHH - comment - 15 Dec 2022

I think what might work would be the following pattern:
~<[^<]*(?<!\/)>(*SKIP)(*F)|(<\w.*\"' . $searchEmail . '\".*\/\>)|' . $searchEmail . '~i

But you have to test it more exactly.
https://regex101.com/r/PJpBIQ/1

avatar brianteeman
brianteeman - comment - 17 Dec 2022

it is not just the cloaking that fails. The ability for a simple typed email address in content being automatically converted to a mailto link also does not happen. This is a major loss of functionality.

avatar LukasHH
LukasHH - comment - 17 Dec 2022

The pattern in line 444 was about cloaking email addresses specified as placeholders or in the title attribute. These are also not returned as a mailto link. That would not fit in these places.

For the case specified in the issiu, an additional pattern would have to be added as it was before.

But I am still there to build a pattern for the case of this specification:
<li title="email@example.org">email@example.org</li>
or
<a title="email@example.org" href="#">email@example.org</a>
These do not currently work with any of the previous patterns.

avatar ReLater ReLater - close - 28 Dec 2022
avatar ReLater
ReLater - comment - 28 Dec 2022

Please test PR #39508

avatar ReLater ReLater - change - 28 Dec 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-12-28 11:12:29
Closed_By ReLater
avatar richard67 richard67 - change - 28 Dec 2022
Labels Removed: Release Blocker
avatar richard67 richard67 - unlabeled - 28 Dec 2022

Add a Comment

Login with GitHub to post a comment