From 4b25348e06a7587c64b97811208352c5c9478ab8 Mon Sep 17 00:00:00 2001 From: Heesung Ahn Date: Sun, 1 Mar 2015 23:21:44 -0500 Subject: test_strip_omage_tags Signed-off-by:Heesung Ahn --- tests/codeigniter/core/Security_test.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/codeigniter/core/Security_test.php') diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php index d967613b5..bf1714622 100644 --- a/tests/codeigniter/core/Security_test.php +++ b/tests/codeigniter/core/Security_test.php @@ -126,5 +126,24 @@ class Security_test extends CI_TestCase { $this->assertEquals('foo', $safe_filename); } + + // -------------------------------------------------------------------- + public function test_strip_image_tags() + { + $imgtags = Array( + 'Smiley face', + '' + ); + + $urls = Array( + 'smiley.gif', + 'http://www.w3schools.com/images/w3schools_green.jpg' + ); + + for($i = 0; $i < count($imgtags); $i++) + { + $this->assertEquals($urls[$i], $this->security->strip_image_tags($imgtags[$i])); + } + } } \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 588a0e3774d1397b9cd0b5f9d0ba2f4793243267 Mon Sep 17 00:00:00 2001 From: Heesung Ahn Date: Thu, 5 Mar 2015 11:03:48 -0500 Subject: adding more img tags Signed-off-by:Heesung Ahn --- tests/codeigniter/core/Security_test.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tests/codeigniter/core/Security_test.php') diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php index bf1714622..c96eecf02 100644 --- a/tests/codeigniter/core/Security_test.php +++ b/tests/codeigniter/core/Security_test.php @@ -133,12 +133,24 @@ class Security_test extends CI_TestCase { { $imgtags = Array( 'Smiley face', - '' + 'Smiley face', + '', + '', + 'MD Logo', + '', + '', + '' ); $urls = Array( 'smiley.gif', - 'http://www.w3schools.com/images/w3schools_green.jpg' + 'smiley.gif', + 'http://www.w3schools.com/images/w3schools_green.jpg', + '/img/sunset.gif', + 'mdn-logo-sm.png', + '', + '', + '' ); for($i = 0; $i < count($imgtags); $i++) -- cgit v1.2.3-24-g4f1b