doumingo04696
doumingo04696
2017-02-06 16:36

Codeigniter - URI不允许的字符

已采纳

I have seen several other questions similar to this but I can't find a solution to my specific problem.

I am getting error The URI you submitted has disallowed characters. When I send the following request:

 http://myrul/login/createNewPassword/reset_token/pwd70xkainz500d57311rli/username/contact%40email.com

Now I have identified that the % in my username is what is triggering the error but I have that allowed in my config file.

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

I though this should allow % to be allowed in the url. If I set config as

$config['permitted_uri_chars'] = '';

Works fine. Is the config string not correct? Or is there another variation of the string I should be using?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • doushan7997 doushan7997 4年前

    contact%40email.com is actually contact@email.com, but urlencoded.

    So, the disallowed character you are sending is @, not %.

    If you add "@" to your permitted_uri_chars you should be alright.

    $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-@';
    
    点赞 1 评论 复制链接分享

相关推荐