douyiyi5284 2014-10-01 16:09
浏览 57
已采纳

在CodeIgniter中接收“不允许的键字符”错误

I am getting the following message: Disallowed Key Characters and the string producing the message seems to be

__utmt_~42

I am just trying to load the page and for the life of me can't figure out why this is happening. It started out of nowhere. How can I locate the source of this?

  • 写回答

5条回答 默认 最新

  • duan01203 2014-10-03 08:12
    关注

    Had a similar problem, so, for the sake of Google search results:

    __utmt is a cookie. More specificly, a Google Analytics cookie. The ~Number part probably means it's a copy/duplicate. Think of it like the word.doc~1 files that are stored on your computer when working in a Word doc.

    So first, check your Analytics code on the website, is there a duplicate somewhere? My problem was solved by altering this duplicated line:

    var pageTracker = _gat._getTracker("UA-1234567-89");
    var pageTracker = _gat._getTracker("UA-1234567-89");
    

    Weird thing is that the file always had this duplicated line of code, for as far as my GIT goes back. It might be a change in the way analytics code handles cookies...

    Oh, and the "Disallowed Key Characters" part. That's normally a good thing, protecting your CI app against evil.

    Its in the system\core\Input.php file.

    if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) {
        // there is no ~ in this regex pattern
        // You could add it, but you probably end up breaking other stuff ("/^[\w:~\/]+$/i")
        exit('Disallowed Key Characters');
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题