Opened 10 years ago
Closed 9 years ago
#13319 closed Bug (expired)
htmlEncodeOutput option not work for ajax submit if jquery adapter used
Reported by: | 613038475 | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Because jquery adapter will override the val function, the value post to server always not encoded.
I tried to set CKEDITOR.config.jqueryOverrideVal = false, but the val function still get override, I can confirm CKEDITOR.config.jqueryOverrideVal is false and attr("value") is encoded from firefox debug console, but the val function still return no encoded.
Change History (7)
comment:1 Changed 10 years ago by
Status: | new → pending |
---|---|
Version: | 4.4.8 (GitHub - master) |
comment:2 Changed 9 years ago by
jquery $.serialize use .val() to get value instead of .attr("value"), that's the reason. jquery adapter make .val() always return the non-encode html.
comment:3 Changed 9 years ago by
When you call .val()
on the CKEditor container, you will get the data returned by getData. Nothing less, nothing more. As I checked when you call .val()
on the <textarea>
you also do not get encoded data, so I do not see the point why CKEditor should do this. CKEditor replace <textarea>
and it should return the same value as <textarea>
.
comment:4 Changed 9 years ago by
the point is without jquery adapter, val() will return encoded html, with jquery adapter, val() will return non-encoded html.
so it will break the htmlEncodeOutput option with $serialize.
also I tried set CKEDITOR.config.jqueryOverrideVal = false, but val() still get override. so the only option is not use jquery adapter.
comment:5 Changed 9 years ago by
the point is without jquery adapter, val() will return encoded html
@613038475 could you recheck this? Are you sure that you are not encoding val results manually somewhere in your application?
I'm asking because @pjasun has said:
As I checked when you call .val() on the <textarea> you also do not get encoded data
and at the moment we have two opposite statements.
Extra question from me: since data returend by adapter is not encoded, can't you encode it yourself manually before sending it to the server?
comment:6 Changed 9 years ago by
I just checked it:
- Added jQuery to replacebycode.html sample.
- Call $( '#editor1' ).val();
And I get not encoded data.
Can you tell me what you did to get encoded html using val()
? Some snippet would be perfect.
comment:7 Changed 9 years ago by
Resolution: | → expired |
---|---|
Status: | pending → closed |
Could you provide reduced HTML file (set of files if needed) that allows reproducing this issue in default CKEditor?
NOTE: I'm particularly interested in how you are getting data from the editor. This is because
or get data directly from editor instance by editor.getData(), encode it if needed and put it into request manually.