解决CI框架的Disallowed Key Characters错误提示
生活随笔
收集整理的這篇文章主要介紹了
解决CI框架的Disallowed Key Characters错误提示
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
用CI框架時,有時候會遇到這么一個問題,打開網頁,只顯示 Disallowed Key Characters 錯誤提示。有人說 url 里有非法字符。但是確定 url 是純英文的,問題還是出來了。但清空瀏覽器歷史記錄和cookies后。 刷新就沒問題了。有時候。打開不同的瀏覽器。有的瀏覽器會有問題。有的就不會。
解決 CodeIgniter 框架應用中,出現Disallowed Key Characters錯誤提示的方法。找到/system/core文件夾下的Input文件,將下面的代碼:
function _clean_input_keys($str) {if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)){exit('Disallowed Key Characters.');}// Clean UTF-8 if supportedif (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 supportedif (UTF8_ENABLED === TRUE){$str = $this->uni->clean_string($str);}return $str; }參考:http://www.nowamagic.net/librarys/veda/detail/1699
?
?推薦一個自己業余時間開發的網盤搜索引擎,360盤搜(www.360panso.com)
總結
以上是生活随笔為你收集整理的解决CI框架的Disallowed Key Characters错误提示的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql优化一
- 下一篇: 用户 Outlook 2007 附件突然