summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter
diff options
context:
space:
mode:
authorHeesung Ahn <ahn.heesung@gmail.com>2015-03-02 05:21:44 +0100
committerHeesung Ahn <ahn.heesung@gmail.com>2015-03-02 05:21:44 +0100
commit4b25348e06a7587c64b97811208352c5c9478ab8 (patch)
tree088c176327e7ef21f22689dd9d38062e7b6092bf /tests/codeigniter
parent43ba5a2da25ff1e0af527da92d89063a3f9d4263 (diff)
test_strip_omage_tags
Signed-off-by:Heesung Ahn <ahn.heesung@gmail.com>
Diffstat (limited to 'tests/codeigniter')
-rw-r--r--tests/codeigniter/core/Security_test.php19
1 files changed, 19 insertions, 0 deletions
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(
+ '<img src="smiley.gif" alt="Smiley face" height="42" width="42">',
+ '<img src="http://www.w3schools.com/images/w3schools_green.jpg">'
+ );
+
+ $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