3.5版本是不是出现:Disallowed Key Characters解决方法

狮
2014-01-06 19:35
591 浏览
0 回复

3.5版本使用的时候i,是不是出现:Disallowed Key Characters.今天百度一下。解决方法是:打开:cscms/core/Input.php 搜索:

function _clean_input_keys($str)
{
 if ( ! preg_match("/^[a-z0-9:_/-]+$/i", $str))
 {
  exit(Disallowed Key Characters.);
 }
 // Clean UTF-8 if supported
 if (UTF8_ENABLED === TRUE)
 {
  $str = $this->uni->clean_string($str);
 }
 return $str;
}


然后更改为:

function _clean_input_keys($str)   
{   
 $config = &get_config(config);   
 if ( ! preg_match("/^[".$config[permitted_uri_chars]."]+$/i", rawurlencode($str)))   
 {   
  exit(Disallowed Key Characters.);   
 }   
 
 // Clean UTF-8 if supported
 if (UTF8_ENABLED === TRUE)
 {
  $str = $this->uni->clean_string($str);
 }
 return $str;   
}  
更改前记得复制保存原来的文件,避免你复制更改代码时弄错,之后可以恢复~!

回复列表(0)