Opened 8 years ago

Closed 8 years ago

#268 closed Bug (fixed)

& in Javascript being converted to '

Reported by: azebchuk Owned by:
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: General Version: FCKeditor 2.4
Keywords: Confirmed Cc:

Description

If you enter a link such as the following in the source view:

<a title="My Page" onClick="pop('/page?id=212&do=something', 372, 445); return false;" href="#">Test</a>

and then goto the preview mode and back to the source, you will find that the editor has changed the link to the following:


<a title="My Page" onClick="pop('/page?id=212'do=something', 372, 445); return false;" href="#">Test</a>

Change History (10)

comment:1 Changed 8 years ago by alfonsoml

#461 has been marked as dup

comment:2 Changed 8 years ago by fredck

  • Milestone set to FCKeditor 2.5

Confirmed with FF2.

With IE6, & are converted to &amp; instead... is this conversion acceptable?

But always with IE, when switching multiple times to source, the & get duplicated.

It happens only because those are event attributes.

comment:3 Changed 8 years ago by fredck

  • Keywords Confirmed added

comment:4 Changed 8 years ago by martinkou

Fixed with [427].

Click here for more info about our SVN system.

comment:5 Changed 8 years ago by martinkou

  • Resolution set to fixed
  • Status changed from new to closed

Oops... [427] does not work in Internet Explorer, I've committed another change set [428] to fix that. Now it should work across Gecko, IE, Safari and Opera.

comment:6 Changed 8 years ago by alfonsoml

These changes broke the handling of popup windows in the link dialog. [443] should fix it.

comment:7 Changed 8 years ago by fredck

  • Resolution fixed deleted
  • Status changed from closed to reopened

Wouldn't encodeURIComponent and decodeURIComponent be enough to fix it, avoiding us to introduce the custom hex translation code?

This is what we have after encoding it with encodeURIComponent:

pop('%2Fpage%3Fid%3D212%26do%3Dsomething'%2C%20372%2C%20445)%3B%20return%20false%3B%2C%2F%3F%3A%40%26%3D%2B%24%23 

Reopening just to check it.

comment:8 Changed 8 years ago by martinkou

  • Resolution set to fixed
  • Status changed from reopened to closed

I've performed some tests and it seems encodeURIComponent() and decodeURIComponent() works pretty well. [703] changes the encoding and decoding logic to use the simpler approach.

comment:9 Changed 8 years ago by fredck

  • Resolution fixed deleted
  • Status changed from closed to reopened

Martin, please take a look at [427] and [443] (taken from the comments in this ticket). It seams that some other parts of the code must be cleaned, modified.

comment:10 Changed 8 years ago by martinkou

  • Resolution set to fixed
  • Status changed from reopened to closed

The code related to the links with popup targets in [443] is already cleaned up in [703]. There's still some leftover code from [427] (in FCKListsLib), though. I've removed it in [707].

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