0

sorry because I had asking the same question before. here is the url CodeIgniter : Disallowed key Characters in Chrome.

I was solving the problem by deleting _ (underScore) in URL. at that time, the problem was solved. later, CodeIgniter give me a Disallowed Key Characters error again and always. I had asking this question in a PHP group in Indonesia, and someone gives me solution that I must delete the cookies in my browser. when I delete the cookies, my application is working well. But several days later, the error is comeback again. Then, I delete the cookies again. It happens over and over again. I don't know what is the point causing this error. For information, I'm using jquery Jtable plugin. I don't know what the relation between this error and jtable plugin but it is first time happen when I was implementing jtable plugin in my application. Anyone have any ideas what I can do to fix this??

Community
  • 1
  • 1
dede
  • 823
  • 4
  • 13
  • 24

2 Answers2

0

I faced similar issues like you and spend much time trying to fix it.

The problem is because of the Jtable as it appends a # in the cookie name which is not allowed by codeigniter for some reason.

You require a minor modification to jTable's Javascript function generateCookieKeyPrefix: function () to replace '#' in the cookie name prefix with ''.

the function _generateCookieKeyPrefix: function () can be found in the jtables js file default name jquery.jtables.js

Hope this answer is useful for you.

Qpd
  • 1
  • 2
  • yes you're right. I solved this but I solved it by editing file input.php in library folder to allow '#' character in the url of Codeigniter. – dede Nov 25 '14 at 04:01
  • yeah that's also a solution to it. nice that you sorted it out :) – Qpd Nov 25 '14 at 04:14
-1

did you check which character give you this message ? This can help you to identify the cause .

Juck
  • 339
  • 1
  • 3
  • 15
  • if it is because some character, why my application working well after I'm deleting the cookies of browser? – dede Oct 03 '14 at 03:54
  • follow my previous link . In the system/codeigniter/system/core/input.php file . change exit(‘Disallowed Key Characters.’); to exit(‘Disallowed Key Characters.’. $str); – Juck Oct 03 '14 at 03:55
  • now I find what character causing this problem. Disallowed Key Characters.jtable#-472140088page-size – dede Oct 03 '14 at 04:21
  • Now I get it, thank you very much..... :D this is can solve it. 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; } – dede Oct 03 '14 at 04:35