From 4fbf2d1a8e2b6d33e92f3f353b05388fd3229bd7 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 21 Sep 2015 16:17:48 +0300 Subject: More XSS stuff --- tests/codeigniter/core/Security_test.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/codeigniter') diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php index b04d25891..ca111c3bf 100644 --- a/tests/codeigniter/core/Security_test.php +++ b/tests/codeigniter/core/Security_test.php @@ -120,6 +120,17 @@ class Security_test extends CI_TestCase { // -------------------------------------------------------------------- + public function text_xss_clean_js_link_removal() + { + // This one is to prevent a false positive + $this->assertEquals( + "", + $this->security->xss_clean("") + ); + } + + // -------------------------------------------------------------------- + public function test_xss_clean_js_img_removal() { $input = 'Clickhere'; @@ -191,6 +202,11 @@ class Security_test extends CI_TestCase { ' on=\'x\' onerror=,xssm()>', $this->security->xss_clean(' on=\'x\' onerror=,xssm()>') ); + + $this->assertEquals( + '', + $this->security->xss_clean('') + ); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b