CodeIgniter Forums
Disallowed Key Characters problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Disallowed Key Characters problem (/showthread.php?tid=49485)



Disallowed Key Characters problem - El Forum - 02-21-2012

[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!


Disallowed Key Characters problem - El Forum - 02-21-2012

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


Disallowed Key Characters problem - El Forum - 02-21-2012

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


Disallowed Key Characters problem - El Forum - 02-21-2012

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


Disallowed Key Characters problem - El Forum - 02-21-2012

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