diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php
index ae7cc0f411..1aace6c4fa 100644
--- a/src/wp-includes/kses.php
+++ b/src/wp-includes/kses.php
@@ -397,15 +397,16 @@ if ( ! CUSTOM_TAGS ) {
),
'var' => array(),
'video' => array(
- 'autoplay' => true,
- 'controls' => true,
- 'height' => true,
- 'loop' => true,
- 'muted' => true,
- 'poster' => true,
- 'preload' => true,
- 'src' => true,
- 'width' => true,
+ 'autoplay' => true,
+ 'controls' => true,
+ 'height' => true,
+ 'loop' => true,
+ 'muted' => true,
+ 'playsinline' => true,
+ 'poster' => true,
+ 'preload' => true,
+ 'src' => true,
+ 'width' => true,
),
);
diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php
index a74903bd80..ab675abbc3 100644
--- a/tests/phpunit/tests/kses.php
+++ b/tests/phpunit/tests/kses.php
@@ -63,6 +63,61 @@ class Tests_Kses extends WP_UnitTestCase {
}
}
+ /**
+ * Test video tag.
+ *
+ * @ticket 50167
+ * @ticket 29826
+ * @dataProvider data_wp_kses_video
+ *
+ * @param string $source Source HTML.
+ * @param string $context Context to use for parsing source.
+ * @param string $expected Expected output following KSES parsing.
+ * @return void
+ */
+ function test_wp_kses_video( $source, $context, $expected ) {
+ $actual = wp_kses( $source, $context );
+ $this->assertSame( $expected, $actual );
+ }
+
+ /**
+ * Data provider for test_wp_kses_video
+ *
+ * @return array[] Array containing test data {
+ * @type string $source Source HTML.
+ * @type string $context Context to use for parsing source.
+ * @type string $expected Expected output following KSES parsing.
+ * }
+ */
+ function data_wp_kses_video() {
+ return array(
+ // Set 0: Valid post object params in post context.
+ array(
+ '',
+ 'post',
+ '',
+ ),
+ // Set 1: Valid post object params in data context.
+ array(
+ '',
+ 'data',
+ '',
+ ),
+ // Set 2: Disallowed urls in post context.
+ array(
+ '',
+ 'post',
+ '',
+ ),
+ // Set 3: Disallowed attributes in post context.
+ array(
+ '',
+ 'post',
+ '',
+ ),
+ );
+ }
+
/**
* @ticket 20210
*/