Codeigniter global_xss_filtering

前端 未结 5 1773
一个人的身影
一个人的身影 2020-12-03 18:53

In my codeigniter config I have $config[\'global_xss_filtering\'] = TRUE;. In my admin section I have a ckeditor which generates the frontend content.

E

5条回答
  •  余生分开走
    2020-12-03 19:06

    My case was that I wanted global_xss_filtering to be on by default but sometimes I needed the $_POST (pst you can do this to any global php array e.g. $_GET...) data to be raw as send from the browser, so my solution was to:

    1. open index.php in root folder of the project
    2. added the following line of code $unsanitized_post = $_POST; after $application_folder = 'application'; (line #92)
    3. then whenever I needed the raw $_POST I would do the following:

      global $unsanitized_post;

      print_r($unsanitized_post);

提交回复
热议问题