开发者

CKEditor not escaping ' in image alts

开发者 https://www.devze.com 2023-02-18 23:17 出处:网络
I have an CKeditor box which upon submission converts special characters to html codes for example: \' becomes '

I have an CKeditor box which upon submission converts special characters to html codes for example: ' becomes '

If there is a ' character in an image alt text or any other html attribute, it doesn't escape and thus, breaks some of my functions. Is there a way around this?

I've not made any modifications to configuration etc. it's the standard setup for CKEditor.

Is there a way to overcome this? Any adjustments would need to be made server side (php).

CKEditor auto escapes certain characters so it works with javascript, but the开发者_如何转开发 function they have to auto escape characters ignores html attributes for some reason. An image alt called "I'm Dancing" would break it.

Basically I have an input form, which collects the data in the fields and sends it to the database just fine. But when I want to use my edit form (which auto-populates the CKEditor with the database contents), the javascript to set the text to the CKEditor fails because of the problem mentioned above. The text originally came from CKEditor and is being returned to CKEditor from the database for editing.


I had a similar problem with backround images once. I fixed it with htmlentities()

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号