How can I get $ _POST full value without any disinfection operation on the codeigniter?

advertisements

I have a controller something like this in codeigniter:

class ABC extends MX_Controller {
  ...
  ...
  ...
   .
   .
   .
  ...
  ...

  public function getTestPostData(){
    print_r($_POST);
  }
}

In getTestPostData when i print $_POST i need full $_POST data without any sanitization of any kind. I can't set $config['global_xss_filtering'] = FALSE; in config.php

How can i achieve that?

Edit:

In post data i am sending some HTML content with some <script>(script) tags, but when i print the data in my controller using $this->input->post("content") the <script>(script)tags gets replace by [removed] tags. This happens when the global_xss_filtering is TRUE. I can't change this value to FALSE.

I hope now the question is clear.


Try this, in my tests it worked even after unsetting $_POST completely.

public function getTestPostData()
{
    $post_data = explode( "&", file_get_contents('php://input') );
    $result = array();

    foreach( $post_data as $post_datum ) {
        $pair = explode("=", $post_datum );

        $result[urldecode($pair[0])] = urldecode($pair[1]);
    }

    print_r( $result );
}