response


  
      function return_response(send_headers = true)
      {
          if (strpos(this->content_type, 'text/html') !== false || strpos(this->content_type, 'xhtml') !== false)
          {
              if (this->flags['remove_scripts'] == 1)
              {
                  this->remove_scripts();
              }
              if (this->flags['show_images'] == 0)
              {
                  this->remove_images();
              }
  
              this->modify_urls();
  
              if (this->flags['include_form'] == 1)
              {
                  this->include_form();
              }
          }
          headers   = explode("\r\n", trim(this->response_headers));
          headers[] = 'Content-Disposition: '. (strpos(this->content_type, 'octet_stream') ? 'attachment' : 'inline') .'; filename='. substr(this->url_segments['path'], strrpos(this->url_segments['path'], '/')+1);
          headers[] = 'Content-Length: '. strlen(this->response_body); 
  
          if (send_headers)
          {
              foreach (headers as header)
              {
                  header(header);
              }
          }
  
          return this->response_body;
      }