Cute Editor designer not encoding all the special charcyers e.g. double quotes ("), < and > etc.

Last post 09-30-2011, 7:33 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  09-30-2011, 2:08 AM 70240

    Cute Editor designer not encoding all the special charcyers e.g. double quotes ("), < and > etc.

    I am using  a  Cute Editor designer in one of mu User Controls, But when i try to save the Designer.Text in the database, then i am observing that it  encodes the various characters e.g. &, < and > etc., but it is not encoding the double quotes ("). Also, sometimes it is not even encoding the < and > if given in some particular sequence.
     
    Because of this encoding when u tru to compare the saved value from  some another value, they are not matched as string.
     
    So, can you please let me know How should i go while comparing the strings so that they are matched even with the encoded string. ? Should I use the HTMLEncode with the latter string which is matched with the CuteEditor text ?
     
    Also, why Cute Editor is not encoding all the characters e.g. double quotes (") etc. ?
  •  09-30-2011, 7:33 AM 70243 in reply to 70240

    Re: Cute Editor designer not encoding all the special charcyers e.g. double quotes ("), < and > etc.

    Hi sanjay.joshi,
     
    For security reason, must encoding these characters. If you do not want to encoding these characters, please use the html filter to replace it.
     
    The example below shows you how to reduction "<" and ">"
     
    <%@ Page Language="C#" %>

    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
            <CE:Editor ID="editor1" runat="server">
            </CE:Editor>
        </form>
    </body>
    </html>

    <script type="text/javascript">      
       function CuteEditor_FilterHTML(editor,code)   
       {   
            code=code.split("&lt;").join("<");
            code=code.split("&gt;").join(">");
            return code;
            
       }   
        function CuteEditor_FilterCode(editor,code)   
        {   
              code=code.split("&lt;").join("<");
            code=code.split("&gt;").join(">");
            return code;
        }   
    </script>
     
     
    Regards,
     
    Ken
View as RSS news feed in XML