【问题标题】:Codeigniter php tags stripping with xss_clean使用 xss_clean 剥离 Codeigniter php 标签
【发布时间】:2011-10-11 13:55:51
【问题描述】:

为什么如果我传递一个$_POST['string'] = "<?php echo 'hey' ?>" 然后我将它传递给带有echo $this->input->post('string',true); 的xss_clean() 它输出为<?php echo 'hey' ?> 而不是<?php echo 'hey' ?> ??

【问题讨论】:

    标签: php codeigniter xss htmlspecialchars


    【解决方案1】:

    如果您查看源代码,您会发现 xss_clean 方法做了很多繁重的工作。这不仅仅是一个htmlspecialchars() 电话。如果您想在页面中显示 php 代码,我会先对其进行转换,然后对其进行清理。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-16
      • 1970-01-01
      • 2016-05-16
      • 2011-12-13
      相关资源
      最近更新 更多