php - Codeigniter is giving me an error called "Disallowed Key Characters." -
i have input name="exam[a+]". have figured out when called $this->input->post("exam")
giving me error called "disallowed key characters". want add + sign in key characters. here code in system file.
function _clean_input_keys($str) { if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) { exit('disallowed key characters.'); } // clean utf-8 if supported if (utf8_enabled === true) { $str = $this->uni->clean_string($str); } return $str; }
how change regular expression add + sign in input. hope have made question clear. if there still confusion please notify me. edit question again. in advance.
use regex allow +
:
^[a-z0-9:_\/+-]+$
the main point unescaped hyphen must @ end of character class.
here a demo.
Comments
Post a Comment