Make WordPress Core

Changeset 40166


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

Embeds: URL encode YouTube video IDs for broader compatibility.

Merge of [40160] to the 4.2 branch.

Location:
branches/4.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2

  • branches/4.2/src/wp-includes/media.php

    r34145 r40166  
    23782378function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
    23792379    global $wp_embed;
    2380     $embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" );
     2380    $embed = $wp_embed->autoembed( sprintf( "https://youtube.com/watch?v=%s", urlencode( $matches[2] ) ) );
    23812381
    23822382    /**
Note: See TracChangeset for help on using the changeset viewer.