?
avatar heleneross
heleneross
10 Sep 2014

Steps to reproduce the issue

create an email address with an html entity in the text of the anchor

<a href="mailto:somebody@somewhere.com">Fred&amp;Tom@somewhere.com</a>

Expected result

Fred&Tom@somewhere.com

Actual result

Fred&amp;Tom@somewhere.com

System information (as much as possible)

J3.3.3

Additional comments

function convertEncoding($text) in libraries/cms/html/email.php seems to be the culprit as it replaces vowels in the text (and also in the entities).

I did a quick kludge by changing this function to:

protected static function convertEncoding($text)
    {
        $text = html_entity_decode($text);

        // Replace vowels with character encoding
        $text = str_replace('a', '&#97;', $text);
        $text = str_replace('e', '&#101;', $text);
        $text = str_replace('i', '&#105;', $text);
        $text = str_replace('o', '&#111;', $text);
        $text = str_replace('u', '&#117;', $text);

        $text = htmlentities($text,ENT_QUOTES,'UTF-8',false);

        return $text;
    }

seems to work but I have probably broken something else!

avatar heleneross heleneross - open - 10 Sep 2014
avatar heleneross heleneross - change - 10 Sep 2014
Category Libraries
avatar heleneross heleneross - change - 10 Sep 2014
The description was changed
avatar n9iels n9iels - reference | - 11 Sep 14
avatar n9iels
n9iels - comment - 11 Sep 2014

Bug confirmed and the suggested fix worked fine for me. I create a PR for this so we can test it and, if everything seems fine, merged it into staging

avatar infograf768
infograf768 - comment - 12 Sep 2014

Good find! Merged. Thanks.

avatar infograf768 infograf768 - close - 12 Sep 2014
avatar infograf768 infograf768 - close - 12 Sep 2014
avatar zero-24 zero-24 - close - 12 Sep 2014
avatar infograf768 infograf768 - change - 12 Sep 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-09-12 08:01:15
avatar zero-24 zero-24 - reference | - 12 Sep 14
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment