Tinymce格式化的内容不是从数据库中显示的

时间:2016-07-27 12:40:01

标签: javascript php mysql tinymce

嗨我在单页中有很多tinymce编辑器。当我在tinymce中格式化内容并将其保存到数据库中。所有标签都保存在mysql中。但是在编辑时我从数据库中获取数据,但是一些(不是全部)无法读取标签并且它显示内容而没有格式化。我的初始化是:

  tinymce.init({
        selector: "textarea", theme: "modern", width: "100%", height: 300,
        plugins: [
        "advlist autolink link image lists charmap print preview hr anchor pagebreak",
        "searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
        "table contextmenu directionality emoticons paste textcolor responsivefilemanager code",
        "paste"
        ],
        paste_retain_style_properties: "all",
        toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",
        toolbar2: "| responsivefilemanager | link unlink anchor | image media | forecolor backcolor  | print preview code ",
        image_caption: true,
        image_advtab: true,
        external_filemanager_path: "<?php echo base_url(); ?>" + "tinymce/file_manager/filemanager/",
        filemanager_title: "Responsive Filemanager",
        external_plugins: {"filemanager": "<?php echo base_url(); ?>" + "tinymce/file_manager/filemanager/plugin.min.js"},
        document_base_url : "<?php echo base_url(); ?>",    
          relative_urls : false, 
          remove_script_host : false,
    });

1 个答案:

答案 0 :(得分:0)

必须进行某种过滤或消毒。

从数据库获取数据后,您可能会使用strip_tags