joomla-cms
joomla-cms copied to clipboard
[4.1] Fix Content - Email Cloaking removes CSS from Link
Pull Request for Issue #36166 .
Summary of Changes
Changes to the content plugin emailcloak.php
- Changes in the respective $replacement specifications
- A change in the last pattern-string
Changes to the file joomla-hidden-mail.js under media/system/js Reason: When setting the tag "joomla-hidden-mail" the class and style attributes are duplicated. Therefore I have them both removed from the tag.
A change to the core.js file Here is the function sanitizeHtml. This had prevented that style specifications are not taken over with images. The attribute "style" was added to the allow list.
Testing Instructions
Include any of the following content with an email in an article. Examples are also in the source code of the "emailcloak" plugin
<p><a href="http://mce_host/ourdirectory/[email protected]" class="btn btn-danger" style="border: 2px solid #f00;">[email protected]</a></p>
<p><a href="http://mce_host/ourdirectory/[email protected]" class="btn btn-danger" style="border: 2px solid #f00;">anytext</a></p>
<p><a href="mailto:[email protected]" class="btn btn-danger" style="border: 2px solid #f00;">[email protected]</a></p>
<p><a href="mailto:[email protected]" class="btn btn-danger" style="border: 2px solid #f00;"><span class="test" style="text-transform: uppercase;">[email protected]</span></a></p>
<p><a href="mailto:[email protected]" class="btn btn-danger" style="border: 2px solid #f00;"><span class="test" style="text-transform: uppercase;">anytext</span></a></p>
<p><a href="mailto:[email protected]" class="btn btn-danger" style="border: 2px solid #f00;">anytext</a></p>
<p><a href="mailto:[email protected]" class="btn btn-danger" style="border: 2px solid #f00;"><img src="images/joomla_black.png" alt="" class="img-thumbnail" style="border: 1px solid #00f;" /></a></p>
<p><a href="mailto:[email protected]" class="btn btn-danger" style="border: 2px solid #f00;"><img src="images/joomla_black.png" alt="" class="img-thumbnail" style="border: 1px solid #00f;" />[email protected]</a></p>
<p><a href="mailto:[email protected]" class="btn btn-danger" style="border: 2px solid #f00;"><img src="images/joomla_black.png" alt="" class="img-thumbnail" style="border: 1px solid #00f;" />any text</a></p>
<p><a href="mailto:[email protected]?subject=Text" class="btn btn-danger" style="border: 2px solid #f00;">[email protected]</a></p>
<p><a href="mailto:[email protected]?subject=Text" class="btn btn-danger" style="border: 2px solid #f00;">anytext</a></p>
<p><a href="mailto:[email protected]?subject= Text" class="btn btn-danger" style="border: 2px solid #f00;"><span class="test" style="text-transform: uppercase;">[email protected]</span></a></p>
<p><a href="mailto:[email protected]?subject= Text" class="btn btn-danger" style="border: 2px solid #f00;"><span class="test" style="text-transform: uppercase;">anytext</span></a></p>
<p><a href="mailto:[email protected]?subject=Text" class="btn btn-danger" style="border: 2px solid #f00;"><img src="images/joomla_black.png" alt="" class="img-thumbnail" style="border: 1px solid #00f;" /></a></p>
<p><a href="mailto:[email protected]?subject=Text" class="btn btn-danger" style="border: 2px solid #f00;"><img src="images/joomla_black.png" alt="" class="img-thumbnail" style="border: 1px solid #00f;" />[email protected]</a></p>
<p><a href="mailto:[email protected]?subject=Text" class="btn btn-danger" style="border: 2px solid #f00;"><img src="images/joomla_black.png" alt="" class="img-thumbnail" style="border: 1px solid #00f;" />any text</a></p>
<p><img src="images/joomla_black.png" alt="" class="img-thumbnail" style="border: 1px solid #00f;" title="[email protected]" /></p>
<p><input type="text" placeholder="[email protected]" /></p>
Actual result BEFORE applying this Pull Request
Expected result AFTER applying this Pull Request
Documentation Changes Required
no changes
I have tested this item :white_check_mark: successfully on 152b089b2429880165e5fc2914d9bdaefd8e17b8
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36269.
@LukasHH thanks for your examples.backend: OK. wanted to test for frontend with prebuilt package. unfortunately can't reach github view (404) for installing prebuilt-package.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36269.
I have tested this item :white_check_mark: successfully on 152b089b2429880165e5fc2914d9bdaefd8e17b8
OK, with automatic e-mail, I got now the prebuilt package via github.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36269.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36269.
Works for me! Great work, thanks! 😊
I have tested this item :white_check_mark: successfully on 152b089b2429880165e5fc2914d9bdaefd8e17b8
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36269.
For me this solves a lot of problems but the first example is broken. It should NOT display the email address at all, even though there is a link around. The email address has to be "cloaked" there too (without a mailto link)
This pull request has automatically rebased to 4.2-dev.
This pull requests has been automatically converted to the PSR-12 coding standard.
@LukasHH would you mind looking into this PR and fix the last issue?
@bembelimen I will see that I can fix the last problem.
@chmst @ChristineWk @khu5h1 Could you test again? The PR has received some change due to a review comment. Thanks in advance.
I have tested this item :white_check_mark: successfully on 35f0e39c699cecc34ac6a641a28783046322f167
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36269.
I have tested this item :white_check_mark: successfully on 35f0e39c699cecc34ac6a641a28783046322f167
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36269.
RTC
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36269.
Thank you very much @LukasHH !