#11312 closed Bug (invalid)
CKEditor and {cke_protected} for "<?" string
| Reported by: | lkopo | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | Core : Parser | Version: | |
| Keywords: | Cc: |
Description
If I try, to write "<?" code into my CKEditor, it will be transformed into
<p><? lol</p>
It's OK. But if I submit my form and page is reloaded I will see:
<p><!--? lol</p--></p>
Change History (4)
comment:1 Changed 12 years ago by
| Keywords: | code parsing cke_protected removed |
|---|---|
| Resolution: | → invalid |
| Status: | new → closed |
| Version: | 4.3 |
comment:2 Changed 12 years ago by
But it does automatically. How can I fix that? I have to use htmlspecialchars() ?
comment:3 Changed 12 years ago by
Your system has to replace every:
<with<&with&>with>
when printing textarea's HTML.

That's because your page does not encode content when outputting it to textarea.
This will work correctly:
This will not:
Because when CKEditor tries to read content from the second textarea it gets:
And that simply isn't correct HTML.