From 2ec770612211d22c25c43a993775ac21ee09794d Mon Sep 17 00:00:00 2001 From: xemlock Date: Sun, 7 May 2017 21:08:23 +0200 Subject: [PATCH] Remove problematic attrs from video and audio --- library/HTMLPurifier/HTML5Definition.php | 26 ++++++++-------------- tests/HTMLPurifier/HTML5DefinitionTest.php | 4 ++-- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/library/HTMLPurifier/HTML5Definition.php b/library/HTMLPurifier/HTML5Definition.php index ed83ea9..a680529 100644 --- a/library/HTMLPurifier/HTML5Definition.php +++ b/library/HTMLPurifier/HTML5Definition.php @@ -33,26 +33,18 @@ public static function setup(HTMLPurifier_HTMLDefinition $def) // http://developers.whatwg.org/the-video-element.html#the-video-element $def->addElement('video', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', array( - 'autoplay' => 'Bool', - 'controls' => 'Bool', - 'height' => 'Length', - 'loop' => 'Bool', - 'mediagroup' => 'Text', - 'muted' => 'Bool', - 'poster' => 'URI', - 'preload' => 'Enum#auto,metadata,none', - 'src' => 'URI', - 'width' => 'Length', + 'controls' => 'Bool', + 'height' => 'Length', + 'poster' => 'URI', + 'preload' => 'Enum#auto,metadata,none', + 'src' => 'URI', + 'width' => 'Length', )); // http://developers.whatwg.org/the-video-element.html#the-audio-element $def->addElement('audio', 'Block', 'Optional: (source, Flow) | (Flow, source) | Flow', 'Common', array( - 'autoplay' => 'Bool', - 'controls' => 'Bool', - 'loop' => 'Bool', - 'mediagroup' => 'Text', - 'muted' => 'Bool', - 'preload' => 'Enum#auto,metadata,none', - 'src' => 'URI', + 'controls' => 'Bool', + 'preload' => 'Enum#auto,metadata,none', + 'src' => 'URI', )); $def->addElement('source', 'Block', 'Empty', 'Common', array('src' => 'URI', 'type' => 'Text')); diff --git a/tests/HTMLPurifier/HTML5DefinitionTest.php b/tests/HTMLPurifier/HTML5DefinitionTest.php index b74d2db..ba7c5d1 100644 --- a/tests/HTMLPurifier/HTML5DefinitionTest.php +++ b/tests/HTMLPurifier/HTML5DefinitionTest.php @@ -46,7 +46,7 @@ public function testFigure() public function testAudio() { - $input = ''; + $input = ''; $output = $this->getPurifier()->purify($input); $this->assertEquals($input, $output); @@ -54,7 +54,7 @@ public function testAudio() public function testVideo() { - $input = ''; + $input = ''; $output = $this->getPurifier()->purify($input); $this->assertEquals($input, $output);