Codeigniter - Disable XSS filtering on a post basis

后端 未结 7 1756
予麋鹿
予麋鹿 2020-12-03 03:25

I\'m trying to set up a CMS on the back of a site but whenever post data has a in it the post data gets scrapped.

I\'ve got $config

7条回答
  •  [愿得一人]
    2020-12-03 03:48

    In my case, treeface's solution doesn't work, but i found another way. I made MY_Input with _sanitize_globals() and I added if construction in place where is sanitizing post data.

    // Clean $_POST Data
    if (is_array($_POST) AND count($_POST) > 0) {
        foreach ($_POST as $key => $val) {
            if($this->_clean_input_keys($key) != 'my_none_sanitize_field')
            $_POST[$this->_clean_input_keys($key)] = $this->_clean_input_data($val);
        }
    }
    

提交回复
热议问题