Ticket #268 (closed Bug: fixed)

Opened 17 months ago

Last modified 12 months ago

& 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

Changed 16 months ago by alfonsoml

#461 has been marked as dup

Changed 15 months 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.

Changed 15 months ago by fredck

  • keywords Confirmed added

Changed 14 months ago by martinkou

Fixed with [427].

Click here for more info about our SVN system.

Changed 14 months ago by martinkou

  • status changed from new to closed
  • resolution set to fixed

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.

Changed 14 months ago by alfonsoml

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

Changed 12 months ago by fredck

  • status changed from closed to reopened
  • resolution deleted

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.

Changed 12 months ago by martinkou

  • status changed from reopened to closed
  • resolution set to fixed

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.

Changed 12 months ago by fredck

  • status changed from closed to reopened
  • resolution deleted

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.

Changed 12 months ago by martinkou

  • status changed from reopened to closed
  • resolution set to fixed

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.