Ticket #34462: 34462.diff
| File 34462.diff, 2.6 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/embed-functions.php
465 465 466 466 $embed_url = get_post_embed_url( $post ); 467 467 468 $output = "<script type='text/javascript'>\n"; 468 $output = '<blockquote><a href="' . get_permalink( $post ) . '">' . get_the_title( $post ) . "</a></blockquote>\n"; 469 470 $output .= "<script type='text/javascript'>\n"; 469 471 $output .= "<!--//--><![CDATA[//><!--\n"; 470 472 if ( SCRIPT_DEBUG ) { 471 473 $output .= file_get_contents( ABSPATH . WPINC . '/js/wp-embed.js' ); … … 710 712 } 711 713 712 714 $allowed_html = array( 713 'iframe' => array( 715 'a' => array( 716 'href' => true, 717 ), 718 'blockquote' => array(), 719 'iframe' => array( 714 720 'src' => true, 715 721 'width' => true, 716 722 'height' => true, … … 724 730 ); 725 731 726 732 $html = wp_kses( $result, $allowed_html ); 727 preg_match( '|^.*(<iframe.*?></iframe>).*$|m', $html, $iframes );728 733 729 if ( empty( $iframes ) ) { 734 preg_match( '|(<blockquote>.*?</blockquote>)?.*(<iframe.*?></iframe>)|ms', $html, $content ); 735 if ( empty( $content[1] ) && empty( $content[2] ) ) { 730 736 return false; 731 737 } 738 $html = $content[1] . $content[2]; 732 739 733 $html = str_replace( '<iframe', '<iframe sandbox="allow-scripts" security="restricted"', $ iframes[1]);740 $html = str_replace( '<iframe', '<iframe sandbox="allow-scripts" security="restricted"', $html ); 734 741 735 742 preg_match( '/ src=[\'"]([^\'"]*)[\'"]/', $html, $results ); 736 743 … … 740 747 $url = esc_url( "{$results[1]}#?secret=$secret" ); 741 748 742 749 $html = str_replace( $results[0], " src=\"$url\" data-secret=\"$secret\"", $html ); 750 $html = str_replace( '<blockquote', "<blockquote data-secret=\"$secret\"", $html ); 743 751 } 744 752 745 753 return $html; -
src/wp-includes/js/wp-embed.js
13 13 return; 14 14 } 15 15 16 var iframes = document.querySelectorAll( '.wp-embedded-content[data-secret="' + data.secret + '"]' ); 16 var iframes = document.querySelectorAll( 'iframe[data-secret="' + data.secret + '"]' ), 17 blockquotes = document.querySelectorAll( 'blockquote[data-secret="' + data.secret + '"]' ); 17 18 18 for ( var i = 0; i < iframes.length; i++ ) { 19 for ( var i = 0; i < blockquotes.length; i++ ) { 20 blockquotes[ i ].style.display = 'none'; 21 } 22 23 for ( i = 0; i < iframes.length; i++ ) { 19 24 var source = iframes[ i ]; 20 25 21 26 /* Resize the iframe on request. */
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)