Firefox"; $washer = new rcube_washtml; $washed = $washer->wash($html); $this->assertRegExp('|href="http://test.com">|', $washed, "Link href with newlines (#1488940)"); } /** * Test XSS in area's href (#5240) */ function test_href_area() { $html = '
' . 'Internet Explorer
' . '' . '' . 'Internet Explorer
' . ''; $washer = new rcube_washtml; $washed = $washer->wash($html); $this->assertNotRegExp('/data:text/', $washed, "data:text/html in area href"); $this->assertNotRegExp('/vbscript:/', $washed, "vbscript: in area href"); $this->assertNotRegExp('/javascript:/', $washed, "javascript: in area href"); } /** * Test handling HTML comments */ function test_comments() { $washer = new rcube_washtml; $html = "p2
"; $washed = $washer->wash($html); $this->assertEquals('p2
', $washed, "HTML conditional comments (#1489004)"); $html = "test
', $washed, "HTML invalid comments (#1487759)"); $html = "para1
para2
"; $washed = $washer->wash($html); $this->assertEquals('para1
para2
', $washed, "HTML comments - simple comment"); $html = "para1
para2
"; $washed = $washer->wash($html); $this->assertEquals('para1
para2
', $washed, "HTML comments - tags inside (#1489904)"); } /** * Test fixing of invalid self-closing elements (#1489137) */ function test_self_closing() { $html = "