You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
720 B
PHP
29 lines
720 B
PHP
<?php
|
|
|
|
/**
|
|
* Test class to test rcube_washtml class
|
|
*
|
|
* @package Tests
|
|
*/
|
|
class Framework_Washtml extends PHPUnit_Framework_TestCase
|
|
{
|
|
|
|
/**
|
|
* Test the elimination of some XSS vulnerabilities
|
|
*/
|
|
function test_html_xss3()
|
|
{
|
|
// #1488850
|
|
$html = '<p><a href="data:text/html,<script>alert(document.cookie)</script>">Firefox</a>'
|
|
.'<a href="vbscript:alert(document.cookie)">Internet Explorer</a></p>';
|
|
|
|
$washer = new rcube_washtml;
|
|
|
|
$washed = $washer->wash($html);
|
|
|
|
$this->assertNotRegExp('/data:text/', $washed, "Remove data:text/html links");
|
|
$this->assertNotRegExp('/vbscript:/', $washed, "Remove vbscript: links");
|
|
}
|
|
|
|
}
|