CKEditor 和字体颜色已保存但不起作用
我刚刚安装了 CKEditor 并使用 JS 标签调用它。 当我保存文本时,所有字体属性(缩进、空格、大小、装饰等)都被正确保存。
问题是,当我想使用 CKEditor 编辑数据时,所有这些属性都已正确加载,但颜色即使在下面的示例中设置为“蓝色”!
这很奇怪,因为当我可以在数据库中看到颜色样式属性时:
<h3 style=\"\\"color:blue\\"\">
<strong>aulne </strong>kjhqsdf <span style=\"\\"color:#008000;\\"\"><u>kjhkjsdfh </u></span>j'<span style=\"\\"\\\\"\\\\"\\"\"><em>espère </em></span><span style=\"\\"\\\\"\\\\"\\"\">bien<sup>2</sup></span></h3>
我发现了这个旧的错误帖子 http ://dev.fckeditor.net/ticket/116 没有找到解决方案的地方。
非常感谢, 问候。
I've just installed CKEditor and call it with JS tag.
When I save the text, all the font attributes (indentation, space, size, decoration,etc.) are correctly saved .
The problem is that when I want to edit the data, with CKEditor, all these attributes are well loaded but the COLOR even if, in the example below, it's set to "BLUE"!
Which is very bizarre because when I can see the color style property in my database:
<h3 style=\"\\"color:blue\\"\">
<strong>aulne </strong>kjhqsdf <span style=\"\\"color:#008000;\\"\"><u>kjhkjsdfh </u></span>j'<span style=\"\\"\\\\"\\\\"\\"\"><em>espère </em></span><span style=\"\\"\\\\"\\\\"\\"\">bien<sup>2</sup></span></h3>
I found this old bug post http://dev.fckeditor.net/ticket/116
where no solution is found.
Thank very much,
regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现了问题:
在 php 方面,在插入之前,我使用了我忘记删除的“addslash”函数。
再次感谢。
I found the problem:
on the php side, before inserting, I was using the "addslash" function I forgot to remove.
Thanks again.
当我注释掉 php 代码中的斜杠时,它停止工作。所以我做了相反的事情,没有去掉斜线。当我读到另一个答案时,我想,昨天我评论了以下内容。现在工作正常了!某些 PHP 模式(例如安全模式)将生成额外的斜杠以减少黑客尝试,因此从具有不同模式的服务器移动代码可能会导致问题。所以这个答案是相同但相反的原因。我的服务器处于安全模式,因此它会自动添加斜杠,我必须删除它们。
$a10 = 条斜杠($a10);
It stopped working when I commented out the stripslashes from the php code. So I was doing the opposite and not stripping the slashes. Once I read the other answer I thought dah, I commented the following out yesterday. Now works fine! Certain PHP modes like safe mode will generate extra slashes to lessen hack attempts so moving code from servers with different modes can cause issues. So this answer is the same but opposite reason. My server is in safe mode so it automatically adds the slashes and I must remove them.
$a10 = stripslashes($a10);