简体   繁体   English

Codeigniter-URI不允许的字符

[英]Codeigniter - URI Disallowed characters

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. 我收到错误消息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. 现在,我已经确定username中的%是触发错误的原因,但我在配置文件中已允许该错误。

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

I though this should allow % to be allowed in the url. 我虽然应该允许在URL中允许% If I set config as 如果我将config设置为

$config['permitted_uri_chars'] = '';

Works fine. 工作正常。 Is the config string not correct? 配置字符串不正确吗? Or is there another variation of the string I should be using? 还是我应该使用的字符串的另一种形式?

contact%40email.com is actually contact@email.com , but urlencoded . contact%40email.com实际上是contact@email.com ,但使用urlencoded

So, the disallowed character you are sending is @ , not % . 因此,您要发送的不允许的字符是@ ,而不是%

If you add "@" to your permitted_uri_chars you should be alright. 如果添加“@”到你permitted_uri_chars你应该是好的。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM