#1908: HtmlEncodeOutput unescapes incorrectly on some strings
----------------------+-----------------------------------------------------
 Reporter:  acolwell  |        Type:  Bug             
   Status:  new       |    Priority:  Normal          
Milestone:            |   Component:  Server : ASP.Net
  Version:  SVN       |    Keywords:                  
----------------------+-----------------------------------------------------
 In FCKeditor.LoadPostData() the code that handles reverting the
 HtmlEncodeOutput changes does not work properly for strings that contain
 "<" or ">".
 The current code replaces '&' before '<' and '>' which causes
 the strings
 mentioned to be converted to '<' and '>' respectively. What should happen
 is that the '&amp;' replacement should happen after the '&lt;' and '&gt;'
 replacement. This allows the strings to be converted to '&lt;' and '&gt;'
 which I believe is the proper decoding.

 Here is a patch that fixes this problem.
 Index: FCKeditor.cs
 ===================================================================
 --- FCKeditor.cs        (revision 1585)
 +++ FCKeditor.cs        (working copy)
 @@ -456,9 +456,9 @@
                         // Revert the HtmlEncodeOutput changes.
                         if ( this.Config["HtmlEncodeOutput"] != "false" )
                         {
 -                               postedValue = postedValue.Replace(
 "&amp;", "&" ) ;
                                 postedValue = postedValue.Replace( "&lt;",
 "<" ) ;
                                 postedValue = postedValue.Replace( "&gt;",
 ">" ) ;
 +                               postedValue = postedValue.Replace("&amp;",
 "&");
                         }

                         if ( postedValue != this.Value )

-- 
Ticket URL: <http://dev.fckeditor.net/ticket/1908>
FCKeditor <http://www.fckeditor.net>
The text editor for Internet
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
FCKeditor-Trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fckeditor-trac

Reply via email to