Changes between Initial Version and Version 1 of Ticket #8704, comment 17


Ignore:
Timestamp:
Aug 6, 2012, 12:04:24 PM (8 years ago)
Author:
Amy McCrobie
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8704, comment 17

    initial v1  
    1616And, in my ajax function I have:
    1717{{{
    18 if(CKEDITOR.instances.editor5 !== undefined){
    19         var editor5 = escape(CKEDITOR.instances.editor5.getData());
    20 }else{
    21         var editor5 = '';
     18var editor5 = '';
     19if(CKEDITOR.instances.editor5 !== undefined)
     20{
     21        var editor5 = encodeURIComponent(CKEDITOR.instances.editor5.getData());
    2222}
    2323}}}
    2424The difference now is the lines I added to config.js. I have had no other reports from users about special characters and Unicode characters showing up in the text from the editor.
     25
     26'''EDIT:''' I changed the code in my ajax function above to use the correct JavaScript function to encode the text from the editor to properly prepare the text to be included in the query string which is sent to the PHP script. Thank you j.swiderski for pointing out the mistake so I could make corrections! For anyone who finds themselves having similar issues, do not use the {{{escape()}}} function, instead use the {{{encodeURIComponent()}}} function. Here is the link j.swiderski posted: [http://stackoverflow.com/questions/75980/best-practice-escape-or-encodeuri-encodeuricomponent].
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy