php - ckeditor - 无法禁用高级内容过滤器

标签 php javascript mysql ckeditor

CKEditor 很不错,但它去掉了所有的 html 标签和 css。这是因为他们新的高级内容过滤器。它破坏了我所有的网页布局。

我尝试在 config.js 中禁用它,但没有任何区别,我整天都在搞这个,并尝试了以下代码的许多变体。谁能在 config.js

中发现任何明显的错误
CKEDITOR.editorConfig = function( config ) {
    config.allowedContent = true;  

    // The toolbar groups arrangement, optimized for a single toolbar row.
    config.toolbarGroups = [
        { name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
        { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
        { name: 'links' },
        { name: 'insert' },
        { name: 'styles' },
        { name: 'colors' },
    ];

    // The default plugins included in the basic setup define some buttons that
    // we don't want too have in a basic editor. We remove them here.
    config.removeButtons = 'Cut,Copy,Paste,Undo,Redo,Anchor,Underline,Strike,About,Others,Forms';

    // Let's have it basic on dialogs as well.
    config.removeDialogTabs = 'link:advanced';
};

最佳答案

我意识到问题不是出在 CKEditor 上。我在 PHP 中通过 htmlentities()striptags() 传递数据,这会删除所有标记。我现在只有 mysql_escape_string() 检查数据。是否可以使用更多函数来清理数据而不弄乱布局?

关于php - ckeditor - 无法禁用高级内容过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17394452/

相关文章:

javascript - angularjs中基于动态行添加+下拉选择

mysql - 如果未找到,则设置值或 NULL

php - 具有多个提交按钮或多个表单的表单

php - 想在 codeigniter 中创建动态子域?

javascript - jquery svg可以将html填充到svg吗?

php - 更改curdate格式

php - 如果其中一个字段为空 PHP,则不将记录加载到数组中

php - fatal error : Class 'PDO' not found

php - 使用 DateTime 获取日期时间从 date() 函数返回不同的值

javascript - 在react.js中渲染时如何移除树的根