Make WordPress Core

Changeset 40162


Ignore:
Timestamp:
03/06/2017 12:04:23 PM (8 years ago)
Author:
ocean90
Message:

Embeds: URL encode YouTube video IDs for broader compatibility.

Merge of [40160] to the 4.6 branch.

Location:
branches/4.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.6

  • branches/4.6/src/wp-includes/embed.php

    r37744 r40162  
    213213function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
    214214    global $wp_embed;
    215     $embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" );
     215    $embed = $wp_embed->autoembed( sprintf( "https://youtube.com/watch?v=%s", urlencode( $matches[2] ) ) );
    216216
    217217    /**
Note: See TracChangeset for help on using the changeset viewer.