Opened 5 years ago

Closed 2 years ago

#9192 closed Bug (fixed)

Link Plugin and emailProtection='encode' problem

Reported by: Stan Owned by: Tomasz Jakut
Priority: Normal Milestone: CKEditor 4.5.5
Component: General Version: 3.1
Keywords: Cc:

Description

When I config CKEditor for emailProtection = 'encode' and try edit already encoded email address, Link Plugin Dialog parse email with postfix 'undefined' like this: test@…

Attachments (5)

1.jpg (40.4 KB) - added by Stan 5 years ago.
2.jpg (39.7 KB) - added by Stan 5 years ago.
3.jpg (43.4 KB) - added by Stan 5 years ago.
4.jpg (40.7 KB) - added by Stan 5 years ago.
i.jpg (42.7 KB) - added by Stan 5 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 Changed 5 years ago by Jakub Ś

Keywords: link email removed
Status: newpending
Version: 3.6.5 (SVN - trunk)

and try edit already encoded email address

  • I have set config.emailProtection = 'encode';
  • Inserted email
  • Edited it again and didn't have a problem.

Where exactly are you getting this issue - isn't this after you save your data into DB and then bring it up again? If that is the case then you should focus on encoding conflicts in your application, server, or DB.
Another thing might be for example double encoding or using wrong method to do that.

Is this the problem you are getting? Could you describe in more detail?

comment:2 Changed 5 years ago by Stan

Its happen only if I no fill email description. When I fill description it is ok.

comment:3 Changed 5 years ago by Jakub Ś

I assume that by description you mean Message Body. Is that correct?

With or without message Body I was not able to reproduce the problem.

Could you please provide step by step scenario explaining how to reproduce this problem?
If possible please provide screen cast (jing if good for these things).

Changed 5 years ago by Stan

Attachment: 1.jpg added

Changed 5 years ago by Stan

Attachment: 2.jpg added

Changed 5 years ago by Stan

Attachment: 3.jpg added

Changed 5 years ago by Stan

Attachment: 4.jpg added

Changed 5 years ago by Stan

Attachment: i.jpg added

comment:4 Changed 5 years ago by Stan

Description means Message Title, but I tested no body content and it is same. And I found problem. Problem is Google Chrome, because in FF it is OK.

comment:5 Changed 5 years ago by Jakub Ś

Status: pendingconfirmed
Version: 3.1

@standus thank you now it's clear.

To reproduce:

  1. set config.emailProtection = 'encode';
  2. Open editor sample
  3. Open link dialog and chooe Email
  4. Fill in only address files E.g. test@test.com
  5. Click OK and then double-click on link to open dialog (or click and use toolbar button)

Result:
Address field will be test@test.comundefined

Problem has been reproducible from CKEditor 3.1 in Webkit, IE and Opera.
Firefox is the only browser that actually works with this TC.

comment:6 Changed 3 years ago by Jakub Ś

#11919 was marked as duplicate.

comment:7 Changed 3 years ago by Stan

What about this bug?

comment:9 Changed 3 years ago by Stan

Not solved to last public version. Now 4.4.6! Ohhhh! Tested with Chrome 39.

Last edited 3 years ago by Stan (previous) (diff)

comment:10 Changed 3 years ago by Jakub Ś

#13022 was marked as duplicate.

comment:11 Changed 2 years ago by Gabriela

I've corrected it in my version, which is CKEditor 3.6.6.

The bug is in file plugins/link/dialogs/link.js. This file is minified, so I took the unminified file from _source/plugins/link/dialogs/link.js.

In unminified file around line 112 there is a function which looks like that:

function ( match, protectedAddress, rest )
{
    if (typeof rest === 'undefined'){
        rest = '';
    }
    return 'mailto:' +
        String.fromCharCode.apply( String, protectedAddress.split( ',' ) ) + 
        ( rest && unescapeSingleQuote( rest ) );
});

and the usage of undefined rest variable causes the erroneous concatenated string. I've added line which checks out the state of the rest variable before return.

if (typeof rest === 'undefined'){
    rest = '';
}
Last edited 2 years ago by Gabriela (previous) (diff)

comment:12 Changed 2 years ago by Marek Lewandowski

Milestone: CKEditor 4.5.5

comment:13 Changed 2 years ago by Tomasz Jakut

Owner: set to Tomasz Jakut
Status: confirmedassigned

comment:14 Changed 2 years ago by Tomasz Jakut

Status: assignedreview

Pushed fix with tests to branch:t/9192.

comment:15 Changed 2 years ago by Marek Lewandowski

Great! Merged to master with git:cda09c7.

comment:16 Changed 2 years ago by Marek Lewandowski

Resolution: fixed
Status: reviewclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy