Bug #23377 » 15461_4-4_phpunit.diff
tests/contrib/removexssTest.php (Arbeitskopie) | ||
---|---|---|
$this->assertEquals($expectedString, $actualString);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function checkAttackHexEncodedCharacter() {
|
||
$testString = '<a href="javascript:alert(123);">click</a>';
|
||
$expectedString = '<a href="ja<x>vascript:alert(123);">click</a>';
|
||
$actualString = RemoveXSS::process($testString);
|
||
$this->assertEquals($expectedString, $actualString);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function checkAttackNestedHexEncodedCharacter() {
|
||
$testString = '<a href="j1;vascript:alert(123);">click</a>';
|
||
$expectedString = '<a href="ja<x>vascript:alert(123);">click</a>';
|
||
$actualString = RemoveXSS::process($testString);
|
||
$this->assertEquals($expectedString, $actualString);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function checkAttackUnicodeNumericalEncodedCharacter() {
|
||
$testString = '<a href="jAvascript:alert(123);">click</a>';
|
||
$expectedString = '<a href="ja<x>vascript:alert(123);">click</a>';
|
||
$actualString = RemoveXSS::process($testString);
|
||
$this->assertEquals($expectedString, $actualString);
|
||
}
|
||
/**
|
||
* @test
|
||
*/
|
||
public function checkAttackNestedUnicodeNumericalEncodedCharacter() {
|
||
$testString = '<a href="j5;vascript:alert(123);">click</a>';
|
||
$expectedString = '<a href="ja<x>vascript:alert(123);">click</a>';
|
||
$actualString = RemoveXSS::process($testString);
|
||
$this->assertEquals($expectedString, $actualString);
|
||
}
|
||
}
|
||
?>
|