[MAGNOLIA-1065] Backslash Gets Stripped from FCK Editor Fields Created: 20/Sep/06  Updated: 23/Jan/13  Resolved: 05/Oct/06

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 3.0 RC2
Fix Version/s: 3.0 RC3

Type: Bug Priority: Minor
Reporter: Sean McMains Assignee: Magnolia International
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Verified on Mac OS X and Linux running Derby and BDB


Attachments: Text File MAGNOLIA-1065-patch.txt    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

If one enteres text with a backslash ( \ ) into an FCK Editor field that text will display on the site fine. However, when you go to edit that paragraph next time, the backslashes will be removed from the FCK Editor field. If one saves at that point, the backslashes will also be removed from the site.



 Comments   
Comment by Sean McMains [ 26/Sep/06 ]

This appears to be a problem with DialogFckEdit.escapeJsValue(), which doesn't attempt to escape the backslash character. For the content "I have a \ backslash", fckInstance.Value should be set to "I have a
backslash" to display correctly.

Comment by Sean McMains [ 03/Oct/06 ]

Further research shows that because the backslash isn't escaped properly, this bug can cause non-printable (and non-exportable) characters to be introduced into a page. For example:

1. Create a new paragraph with the "sample: editor" paragraph type.
2. Enter the text "Here is a \backslash"
3. Save the paragraph. It will appear correctly.
4. Click the edit button for the paragraph.
5. The edit window shows "Here is a ackslash". Don't change anything, just save.
6. The "\b" has now been turned into an ASCII 8 backslash character.
7. The page with the paragraph can no longer be activated or exported because of the non-printable character.

Comment by Sean McMains [ 04/Oct/06 ]

This patch fixes this problem by using the Apache Commons StringEscapeUtils package (which is already used elsewhere in Magnolia) to do the escaping, rather than custom search and replace code.

Comment by Magnolia International [ 05/Oct/06 ]

Patch applied and tests added - thanks !

Generated at Mon Feb 12 03:23:19 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.