CodeIgniter Forums
Disallowed Key Characters in url - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Disallowed Key Characters in url (/showthread.php?tid=70055)



Disallowed Key Characters in url - penteka - 02-13-2018

Dear All,

I 'm facing with this problem:
If I write URL with non-allowed characters like: xyz.hu/csöcsösnyúl I got this message: "Disallowed Key Characters.csöcsösnyúl". It is ok.
But If I call xyz.hu URL again I got the same message: Disallowed Key Characters.csöcsösnyúl. Why? If I delete the browser cache, or use incognito window, I can call the xyz.hu without error.
I don't understand  why.
Any idea?
Thanks in advance


Penteka


RE: Disallowed Key Characters in url - penteka - 02-13-2018

Hi all
 I've found this code:  source

Code:
$CFG =& load_class('Config');
        
$cook_key = array_keys($_COOKIE);
$safe_cook_key = array( '__utm',                        //google analytics
$CFG->item('cookie_prefix'));
foreach($cook_key as $val)
{          
   if(substr_compare($val, $safe_cook_key[0],0, strlen($safe_cook_key[0]))!=0 && substr_compare($val, $safe_cook_key[1],0, strlen($safe_cook_key[0]))!=0)
   {
       unset($_COOKIE[$val]);
   }              
}
$_COOKIE = $this->_clean_input_data($_COOKIE);

I inserted into system/core/Input.php. Now it works properly.
Ya hey!

Any comments very welcome Smile
Thx

penteka


RE: Disallowed Key Characters in url - InsiteFX - 02-14-2018

You should never edit and mess with the System Core Files!!!

You extend them to make modifications.


RE: Disallowed Key Characters in url - penteka - 02-15-2018

(02-14-2018, 04:49 AM)InsiteFX Wrote: You should never edit and mess with the System Core Files!!!

You extend them to make modifications.

Hi InsiteFx,
Thank you for your response.

Please give me a suggestion how to extend the Input.php file correctly. 

thanks in advance

penteka


RE: Disallowed Key Characters in url - InsiteFX - 02-15-2018

This is saved in - ./application/core/MY_Input.php

PHP Code:
class MY_Input extends CI_Input
{



If Library is in ./system/core then you      - Save in ./application/core/Filename.php

If Library is in ./system/libraries then you - Save in ./application/libraries/Filename.php