Skip to content

Instantly share code, notes, and snippets.

@arunoda

arunoda/xss.php Secret

Created June 15, 2012 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arunoda/040017831024bd0c75cf to your computer and use it in GitHub Desktop.
Save arunoda/040017831024bd0c75cf to your computer and use it in GitHub Desktop.
Codeigniter - XSS Prevention
<?php
class Xss extends CI_Controller {
public function index() {
$this->load->helper("form");
echo form_open("xss/show", array("method" => "POST"));
echo form_textarea(array("name" => "code"));
echo "<br>";
echo form_submit(array("value" => "Please Submit"));
echo form_close();
}
public function show() {
$this->load->library("input");
$code = $this->input->post("code");
echo $code;
//echo $this->security->xss_clean($code);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment