开发者

What is causing the Disallowed Key Characters error?

开发者 https://www.devze.com 2023-03-11 18:24 出处:网络
Is there a way to find what part of my code is causing the Disallowed Key Characters开发者_运维问答 error in Codeigniter?It\'s could be a \"bad\" form input name that you are trying to run through the

Is there a way to find what part of my code is causing the Disallowed Key Characters开发者_运维问答 error in Codeigniter?


It's could be a "bad" form input name that you are trying to run through the Form_validation library. This is the only time I've had this issue, but it could be a $_GET key as well.

Without more details from you, it's hard to say - but there's a good place to check.


Wesley,

I have no idea if this will be your answer, but I figured I would contribute it just in case someone also had the same error as myself.

I think I have gotten this error when I had a dis-allowed character in a url string. It turned out that I had a underscore character in one of my controller class names.

I believe there is a setting in the config file for codeigniter where you can specify allowed characters in the URL string.

I am at work and don't have access to a copy of the Code Igniter files, but when I searched the CI website I did find this:

CodeIgniter Changelog

In the change log notes for version 1.4.0 they mention that they moved the "allowed characters" settings out of "routes.php" file and into the "config.php" file. The actual line says:

Moved the list of "allowed URI characters" out of the Router class and into the config file.

I believe the list of "allowed URI charcters" is an array that specifies what characters can be used in naming conventions for URL/URI. You might want to check your config.php file and see what characters are currently allowed and see if you are using any of those not allowed characters in your URI, as this could also potentially trigger your error.

Good luck!

Edit: In the change log for version 1.7.1 they mention this:

A "HTTP/1.1 400 Bad Request" header is now sent when disallowed characters are encountered.

0

精彩评论

暂无评论...
验证码 换一张
取 消