Make WordPress Core

Changeset 35406


Ignore:
Timestamp:
10/26/2015 11:54:04 PM (9 years ago)
Author:
pento
Message:

Embeds: Add a CDATA and HTML comment wrapper around the JavaScript included in the embed HTML. This ensures that user agents which naively strip unwanted tags, without also stripping the content within those tages (for example, Slack), don't show the embed as a mess of JavaScript.

Props peterwilsoncc.

Fixes #34429.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/embed-functions.php

    r35394 r35406  
    467467
    468468    $output = "<script type='text/javascript'>\n";
     469    $output .= "<!--//--><![CDATA[//><!--\n";
    469470    if ( SCRIPT_DEBUG ) {
    470471        $output .= file_get_contents( ABSPATH . WPINC . '/js/wp-embed.js' );
     
    484485JS;
    485486    }
     487    $output .= "\n//--><!]]>";
    486488    $output .= "\n</script>";
    487489
Note: See TracChangeset for help on using the changeset viewer.