CKEditor 没有转义 '在图像替代中
我有一个 CKeditor 框,提交后会将特殊字符转换为 html 代码,例如: '
变为 '
如果有 '
图像替代文本或任何其他 html 属性中的字符,它不会转义,因此会破坏我的一些功能。有办法解决这个问题吗?
我没有对配置等进行任何修改。这是 CKEditor 的标准设置。
有办法克服这个问题吗?任何调整都需要在服务器端(php)进行。
CKEditor 自动转义某些字符,因此它可以与 javascript 一起使用,但由于某种原因,它们自动转义字符的功能会忽略 html 属性。一个名为“我在跳舞”的图像替代品会打破它。
基本上我有一个输入表单,它收集字段中的数据并将其发送到数据库。但是,当我想使用我的编辑表单(它会使用数据库内容自动填充 CKEditor)时,由于上述问题,将文本设置为 CKEditor 的 javascript 会失败。文本最初来自 CKEditor,并从数据库返回到 CKEditor 进行编辑。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我曾经在背景图像上遇到过类似的问题。我用 htmlentities() 修复了它
I had a similar problem with backround images once. I fixed it with htmlentities()