zoukankan      html  css  js  c++  java
  • 谷歌插件请求ci 解决CI框架的Disallowed Key Characters错误提示

    用CI框架时,有时候会遇到这么一个问题,打开网页,只显示 Disallowed Key Characters 错误提示。有人说 url 里有非法字符。但是确定 url 是纯英文的,问题还是出来了。但清空浏览器历史记录和cookies后。 刷新就没问题了。有时候。打开不同的浏览器。有的浏览器会有问题。有的就不会。

    解决 CodeIgniter 框架应用中,出现Disallowed Key Characters错误提示的方法。找到core文件夹下的Input文件,将下面的代码:

    	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;   
    	}  
    

    或者改成:

    	function _clean_input_keys($str)
    	{
    		if(preg_match("/^,_[a-z0-9:_/-]+$/",$str)){
    			$str = preg_replace("/,_/","",$str);
     		}
                     
         	if ( ! preg_match("/^[a-z0-9:_/-]+$/i", $str))
          	{
          		exit('Disallowed Key Characters.'.$str);
        	}
    		return $str;
    	}
    

    大概就这样~留个记录。

  • 相关阅读:
    判断整除
    洛谷2018-7月月赛
    luogu_P1177 【模板】快速排序 (快排和找第k大的数)
    lowbit() 运算
    64位整数乘法 (二进制思想)
    poj_1995 Raising Modulo Numbers (快速幂)
    poj_3179 Corral the Cows (二分+二维前缀和+离散化)
    Spring-profile 不同环境配置方法
    Spring-id,name 名称,别名关系
    Leecode no.20 合理的括号
  • 原文地址:https://www.cnblogs.com/brady-wang/p/6874566.html
Copyright © 2011-2022 走看看