• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disallowed Key Characters problem

#1
[eluser]sigornjw[/eluser]
Hi,
In my code I receive post value with "!" character.
To avoid "Disallowed Key Characters" problem I'm using MY_Input.php class in application/core:
Code:
<?php
class MY_Input extends CI_Input {
  function __construct()
  {
    parent::__construct();
  }

  function _clean_input_keys($str)
  {
    if ( ! preg_match("/^[a-z0-9!:_\/-]+$/i", $str))
    {
      exit('Disallowed Key Characters: '.$str);
    }

    // Clean UTF-8 if supported
    if (UTF8_ENABLED === TRUE)
    {
      $str = $this->uni->clean_string($str);
    }

    return $str;
  }
}
<b>It takes effect on my local mashine</b> but <b>it doesn't work on the web</b>!?

Any help, please!

#2
[eluser]CroNiX[/eluser]
Why don't you just add the ! to the allowed characters?

#3
[eluser]sigornjw[/eluser]
i've tried - nothing changed both on the web & local!

#4
[eluser]CroNiX[/eluser]
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-!';
Strange, the above works for me on live and production.

#5
[eluser]sigornjw[/eluser]
Yes, it's really very strange but... it's a fact. I used the same parameters & nothing changed.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.