Friday, February 3, 2012

code ignitor: Getting the error “Disallowed Key Characters”

Code Ignitor: Getting the error “Disallowed Key Characters” ?

   In Codeignitor, its usual for the developer getting the Error: "Disallowed Key Characters"
 This error used to drove newbies nuts. I am not sure about the reason and the fix provided by codeignitor help page not works some times[Most of the times from my experience]. It is also difficult to find what caused the error.

Here is solution that help in diagnosis of the problem.

In the core CI code in system/libraries is a file called input.php This small modification would show the actual data that caused the Problem.

Around line number 199

function _clean_input_keys($str)
if ( ! preg_match(“/^[a-z0-9:_\/-]+$/i”, $str))
exit(‘Disallowed Key Characters: ‘.$str);
// The variable $str was added to display the data in question.
return $str;

No comments:

Post a Comment