[wp-trac] [WordPress Trac] #32807: <audio><video>tags not closed properly

WordPress Trac noreply at wordpress.org
Sun Jun 28 01:18:55 UTC 2015


#32807: <audio><video>tags not closed properly
-------------------------------+------------------------------
 Reporter:  patilswapnilv      |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => reporter-feedback


Old description:

> The <audio> and <video> tags are not closed properly in the media-
> template.php file in wp-includes.
>
> line no. 19, 811 and 91
>

> {{{
> <<audio style="visibility: hidden"
>         controls
>         class="wp-audio-shortcode"
>         width="{{ _.isUndefined( data.model.width ) ? 400 :
> data.model.width }}"
>         preload="{{ _.isUndefined( data.model.preload ) ? 'none' :
> data.model.preload }}"
>         <#
>         <?php foreach ( array( 'autoplay', 'loop' ) as $attr ):
>         ?>if ( ! _.isUndefined( data.model.<?php echo $attr ?> ) &&
> data.model.<?php echo $attr ?> ) {
>                 #> <?php echo $attr ?><#
>         }
>         <?php endforeach ?>#>
> >
>         <# if ( ! _.isEmpty( data.model.src ) ) { #>
>         <source src="{{ data.model.src }}" type="{{
> wp.media.view.settings.embedMimes[ data.model.src.split('.').pop() ] }}"
> />
>         <# } #>
>
>         <?php foreach ( $audio_types as $type ):
>         ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) { #>
>         <source src="{{ data.model.<?php echo $type ?> }}" type="{{
> wp.media.view.settings.embedMimes[ '<?php echo $type ?>' ] }}" />
>         <# } #>
>         <?php endforeach;
> ?></audio>
> }}}
>
> though the tag is closed later on line 43, I think that is not the
> correct way.

New description:

 The <audio> and <video> tags are not closed properly in the media-
 template.php file in wp-includes.

 line no. 19, 811 and 91


 {{{
 <audio style="visibility: hidden"
         controls
         class="wp-audio-shortcode"
         width="{{ _.isUndefined( data.model.width ) ? 400 :
 data.model.width }}"
         preload="{{ _.isUndefined( data.model.preload ) ? 'none' :
 data.model.preload }}"
         <#
         <?php foreach ( array( 'autoplay', 'loop' ) as $attr ):
         ?>if ( ! _.isUndefined( data.model.<?php echo $attr ?> ) &&
 data.model.<?php echo $attr ?> ) {
                 #> <?php echo $attr ?><#
         }
         <?php endforeach ?>#>
 >
         <# if ( ! _.isEmpty( data.model.src ) ) { #>
         <source src="{{ data.model.src }}" type="{{
 wp.media.view.settings.embedMimes[ data.model.src.split('.').pop() ] }}"
 />
         <# } #>

         <?php foreach ( $audio_types as $type ):
         ?><# if ( ! _.isEmpty( data.model.<?php echo $type ?> ) ) { #>
         <source src="{{ data.model.<?php echo $type ?> }}" type="{{
 wp.media.view.settings.embedMimes[ '<?php echo $type ?>' ] }}" />
         <# } #>
         <?php endforeach;
 ?></audio>
 }}}

 though the tag is closed later on line 43, I think that is not the correct
 way.

--

Comment:

 Link to source: https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/media-template.php#L16

 Hi @patilswapnilv, can you explain what the actual problem is here? The
 tags appear to be closed correctly. Note: The `<source>` tags must be
 within the `<audio>...</audio>` tags.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32807#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list