Synchronize allowed attributes for <audio> with Parsoid/TimedMediaHandler
authorC. Scott Ananian <cscott@cscott.net>
Mon, 22 Apr 2019 16:40:43 +0000 (12:40 -0400)
committerC. Scott Ananian <cscott@cscott.net>
Mon, 22 Apr 2019 17:04:49 +0000 (13:04 -0400)
We synchronized the allowed attributes for <video> in
4e7483ffd31dd05c11b16bf37552c25ed648bd0a but then decided to use the
<audio> tag for audio media in Parsoid commit
5f3dbdc8794f2605101609f28e679df29a0387bc and updated its Sanitizer,
but never updated core to match.

Bug: T163583
Bug: T133673
Change-Id: Iefcbead2f335949eb45e2880861fd9473b810367

includes/parser/Sanitizer.php

index 518846c..35a5944 100644 (file)
@@ -1918,7 +1918,8 @@ class Sanitizer {
                        # such as <math> when it is rasterized, or if $wgAllowImageTag is
                        # true
                        'img'        => array_merge( $common, [ 'alt', 'src', 'width', 'height', 'srcset' ] ),
-
+                       # Attributes for A/V tags added in T163583 / T133673
+                       'audio'      => array_merge( $common, [ 'controls', 'preload', 'width', 'height' ] ),
                        'video'      => array_merge( $common, [ 'poster', 'controls', 'preload', 'width', 'height' ] ),
                        'source'     => array_merge( $common, [ 'type', 'src' ] ),
                        'track'      => array_merge( $common, [ 'type', 'src', 'srclang', 'kind', 'label' ] ),