简体   繁体   English

“安全”助手在CodeIgniter中不起作用

[英]'Security' helper not working in CodeIgniter

I am using CodeIgniter v 3.1.4. 我正在使用CodeIgniter v 3.1.4。 In one of the form, i have a text box to save urls (like https://stackoverflow.com/questions/ask , http://google.com etc.) into the MySql database. 在形式之一,我有一个文本框的网址(例如保存https://stackoverflow.com/questions/askhttp://google.com等)到MySQL数据库。

Before save, i am sanitizing the urls like shown below: 保存之前,我正在清理如下所示的网址:

Inside Constructor: 内部构造函数:

$this->load->helper('security');

Inside Add function: 内部添加功能:

$hlt_url    = $this->security->xss_clean($this->input->post('txtHLnk'));
$hlt_hlines = $this->security->xss_clean($this->input->post('txtAreaHLine'));

When i enter simple/plain string in the textboxes, then the data gets saved in the DB, however when i enter url in the textboxes, the data is not saved in DB, neither does it show any error message. 当我在文本框中输入简单/纯字符串时,数据将保存在数据库中,但是当我在文本框中输入url时,数据未保存在DB中,也不会显示任何错误消息。

Please explain with code whats i am doing wrong. 请用代码解释我做错了什么。 Thanks 谢谢

$hlt_url = $this->input->post('txtHLnk', true); $hlt_hlines = $this->input->post('txtAreaHLine', true);

我想这是最新版本中清理输入的新实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM