CodeIgniter自动过滤非法字符Input.php

来源:互联网 发布:淘宝店铺号怎么隐藏 编辑:程序博客网 时间:2024/05/22 10:28

最近在用CodeIgniter_1.7.0框架开发程序,同时也用到了dhtmlxGrid。

在使用dhtmlxGridDataprocessor功能时需要用到变量!nativeeditor_status

因为提交时ci会自动判断非法字符,所以当发现非法字符时,就会exit();终止执行

具体位置在 CodeIgniter_1.7.0/system/libraries/Input.php 214行,以下代码已经加了!为合法字符

/**
  * Clean Keys
  *
  * This is a helper function. To prevent malicious users
  * from trying to exploit keys we make sure that keys are
  * only named with alpha-numeric text and a few other items.
  *
  * @access private
  * @param string
  * @return string
  */
 function _clean_input_keys($str)
 {
   if ( ! preg_match("/^[a-z0-9:!_//-]+$/i", $str))
   {
   exit('Disallowed Key Characters.');
   }

  return $str;
 }

原创粉丝点击