From 9b05f19338e209f05386e5b13fe0a704c94062bb Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 27 Aug 2012 08:45:13 +0200 Subject: Restructured tests --- tests/ModCss.php | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 tests/ModCss.php (limited to 'tests/ModCss.php') diff --git a/tests/ModCss.php b/tests/ModCss.php deleted file mode 100644 index 38cf84c9d..000000000 --- a/tests/ModCss.php +++ /dev/null @@ -1,39 +0,0 @@ -assertRegExp('/#rcmbody\s+\{/', $mod, "Replace body style definition"); - $this->assertRegExp('/#rcmbody h1\s\{/', $mod, "Prefix tag styles (single)"); - $this->assertRegExp('/#rcmbody h1, #rcmbody h2, #rcmbody h3, #rcmbody textarea\s+\{/', $mod, "Prefix tag styles (multiple)"); - $this->assertRegExp('/#rcmbody \.noscript\s+\{/', $mod, "Prefix class styles"); - } - - function test_xss() - { - $mod = rcmail_mod_css_styles("body.main2cols { background-image: url('../images/leftcol.png'); }", 'rcmbody'); - $this->assertEquals("/* evil! */", $mod, "No url() values allowed"); - - $mod = rcmail_mod_css_styles("@import url('http://localhost/somestuff/css/master.css');", 'rcmbody'); - $this->assertEquals("/* evil! */", $mod, "No import statements"); - - $mod = rcmail_mod_css_styles("left:expression(document.body.offsetWidth-20)", 'rcmbody'); - $this->assertEquals("/* evil! */", $mod, "No expression properties"); - - $mod = rcmail_mod_css_styles("left:exp/* */ression( alert('xss3') )", 'rcmbody'); - $this->assertEquals("/* evil! */", $mod, "Don't allow encoding quirks"); - - $mod = rcmail_mod_css_styles("background:\\0075\\0072\\006c( javascript:alert('xss') )", 'rcmbody'); - $this->assertEquals("/* evil! */", $mod, "Don't allow encoding quirks (2)"); - } -} -- cgit v1.2.3