Skip to content

Commit

Permalink
MDL-55581 htmlpurifier: test for attributes in video tag
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Aug 30, 2016
1 parent bb75b82 commit 0df9dce
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions lib/tests/htmlpurifier_test.php
Expand Up @@ -448,7 +448,7 @@ public function media_tags_provider() {
'No tasty jams for you.' .
'</video>' .
'</div>'
]) + $generatetestcases('Video with invalid crossorigin', $videoattrs, [
]) + ['Video with invalid crossorigin' => [
'<video src="http://example.com/turnitup.mov" crossorigin="can i pls hab?">' .
'Oh, that\'s pretty bad 😦' .
'</video>',
Expand All @@ -457,7 +457,7 @@ public function media_tags_provider() {
'Oh, that\'s pretty bad 😦' .
'</video>' .
'</div>'
]) + $generatetestcases('Audio with invalid crossorigin', $audioattrs, [
]] + ['Audio with invalid crossorigin' => [
'<audio src="http://example.com/getup.wav" crossorigin="give me. the jams.">' .
'nyemnyemnyem' .
'</audio>',
Expand All @@ -466,6 +466,19 @@ public function media_tags_provider() {
'nyemnyemnyem' .
'</audio>' .
'</div>'
]);
]] + ['Other attributes' => [
'<video src="http://example.com/turnitdown.mov" class="nofilter" data-something="data attribute" someattribute="somevalue" onclick="boom">' .
'<source src="http://example.com/getup.wav" type="audio/wav" class="shouldberemoved" data-sourcedata="source data" onmouseover="kill session" />' .
'<track src="http://example.com/subtitles_en.vtt" class="shouldberemoved" data-trackdata="track data" onmouseover="removeme" />' .
'Do not remove attribute class but remove other attributes' .
'</video>',
'<div class="text_to_html">' .
'<video src="http://example.com/turnitdown.mov" class="nofilter">' .
'<source src="http://example.com/getup.wav" type="audio/wav" />' .
'<track src="http://example.com/subtitles_en.vtt" />' .
'Do not remove attribute class but remove other attributes' .
'</video>' .
'</div>'
]];
}
}

0 comments on commit 0df9dce

Please sign in to comment.