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

时间:2013-06-30 20:14:28

标签: 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';
};

1 个答案:

答案 0 :(得分:0)

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