Closed kkksc03 closed 10 years ago
其实问题不是出自这里,应该是这里
// Clean $_POST Data
if (is_array($_POST) AND count($_POST) > 0)
{
foreach ($_POST as $key => $val)
{
$_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);//fuck
}
}
function _clean_input_data($str)
{
//省略
// Remove control characters
$str = remove_invisible_characters($str);
// Should we filter the input data?
if ($this->_enable_xss === TRUE)
{
$str = $this->security->xss_clean($str);
}
// Standardize newlines if needed
if ($this->_standardize_newlines == TRUE)
{
if (strpos($str, "\r") !== FALSE)
{
$str = str_replace(array("\r\n", "\r", "\r\n\n"), PHP_EOL, $str);
}
}
return $str;
}
上面的函数原型是function remove_invisible_characters($str, $url_encoded = TRUE) 由于没有第2项取了默认值TRUE,所以。。。
这是已知问题,目前已经修复。
这边在“不可见字符”加上了引号。 在post一个数据时,内容包括"%10",这是3个字符组成的字符串而不是一个不可见字符,是在文本框中输入的。但是ci的input类会把"%10"这3个字符也给屏蔽了。 ci的上下文如下:
其中,我认为/%0[0-8bcef]/这个正则有点问题,因为%不是正则表达式的元字符,他会把%10这样的给屏蔽掉。