【问题标题】:Codeigniter summernote fail resultCodeigniter summernote 失败结果
【发布时间】:2015-01-02 13:03:21
【问题描述】:

我正在使用带有 Summernote 编辑器的 codeigniter 框架。

如果我在没有框架的情况下使用php post中的单个页面,结果是这样的:

<span style="font-weight: bold;">asdasdasd</span>

但如果我在 codeigniter 中使用 post,结果会有所不同,如下所示:

<span  bold;">asdasdasd</span>

style='font-weight: ' 不见了..

为什么会这样,解决方法是什么?
感谢您的帮助。

【问题讨论】:

  • 你能显示代码吗?
  • 代码就像summernote gist,但我在codeigniter页面中使用它..

标签: codeigniter summernote


【解决方案1】:

我得到了答案……

在 codeigniter 中不要使用:

$_POST['content'] OR $_GET['content']

但使用:

$_REQUEST['content']

问题解决了!

【讨论】:

    【解决方案2】:

    我认为是xss过滤器问题,尝试禁用或将值设置为false。

    $content = $this->input->post('content', FALSE);
    

    我已经用原始的 Summernote 示例进行了编辑:

    <div class="span12">
            <h2>POST DATA</h2>
            <pre>
            <?php print_r($this->input->post(NULL, FALSE)); ?>
            </pre>
            <pre>
            <?php echo htmlspecialchars($this->input->post('content', FALSE)); ?>
            </pre>
        </div>
    

    【讨论】:

      猜你喜欢
      • 2021-03-08
      • 2017-10-27
      • 2013-04-22
      • 2020-10-12
      • 2014-01-13
      • 2016-08-22
      • 2018-04-04
      • 1970-01-01
      • 2022-08-06
      相关资源
      最近更新 更多