Make WordPress Core

Changeset 40161


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

Embeds: URL encode YouTube video IDs for broader compatibility.

Merge of [40160] to the 4.7 branch.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

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

    r38361 r40161  
    227227function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
    228228    global $wp_embed;
    229     $embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" );
     229    $embed = $wp_embed->autoembed( sprintf( "https://youtube.com/watch?v=%s", urlencode( $matches[2] ) ) );
    230230
    231231    /**
Note: See TracChangeset for help on using the changeset viewer.