ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Note: "Disallowed key characters"

November 04, 2011 7:14am

Subscribe [2]
  • #1 / Nov 04, 2011 7:14am

    Pål Degerstrøm

    28 posts

    I just upgraded a client site to the latest release, and experienced the “Disallowed key characters” thing again. I’m writing down my fix in case someone experiences the same thing.

    I am unsure of why this happens, but it seems that the cookie cleaning operations fails on some cookie values, even if they have nothing to do with your ExpressionEngine install.

    Anyway, here is how I got it to work:

    In my config.php, I set the cookie prefix:

    $config['cookie_prefix'] = 'prefix'; // Obviously, not the one I actually use…

    Then, I opened up codeigniter/system/core/Input.php, and on line 459, changed:

    foreach($_COOKIE as $key => $val)
    {
      $_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
    }

    to

    foreach($_COOKIE as $key => $val)
    {
      if (substr($key, 0 , 6) == 'prefix') // Check for the same cookie prefix, make sure the length (6) matches the prefix length
      {
        $_COOKIE[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
      }
    }

    This should force ExpressionEngine to only clean the cookies that are relevant for it, leaving any others alone.

    If anyone has comments or improvements, I’m all ears.

    (The first time I did this was minutes after the site launched a while ago, and none of the employees at the client could access the site. In my case at least, the problem seemed related to those that had accessed the site while it was being developed. Searching and hacking a live site was no fun.)

    Best,
    Pål

  • #2 / Nov 04, 2011 5:27pm

    Kevin Smith

    4784 posts

    Hi Pål,

    Thanks for posting this. Since the best place for this is in the bug tracker, I went ahead and posted this there instead. That will alert the developers and if they have a better solution, they’ll post it there and close up that bug report. (Your solution involves changing the CodeIgniter core, so they might have a different solution for it.)

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases