mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@35406 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -466,6 +466,7 @@ function get_post_embed_html( $post = null, $width, $height ) {
|
||||
$embed_url = get_post_embed_url( $post );
|
||||
|
||||
$output = "<script type='text/javascript'>\n";
|
||||
$output .= "<!--//--><![CDATA[//><!--\n";
|
||||
if ( SCRIPT_DEBUG ) {
|
||||
$output .= file_get_contents( ABSPATH . WPINC . '/js/wp-embed.js' );
|
||||
} else {
|
||||
@@ -483,6 +484,7 @@ function get_post_embed_html( $post = null, $width, $height ) {
|
||||
include "js/wp-embed.min.js"
|
||||
JS;
|
||||
}
|
||||
$output .= "\n//--><!]]>";
|
||||
$output .= "\n</script>";
|
||||
|
||||
$output .= sprintf(
|
||||
|
||||
Reference in New Issue
Block a user