Changeset 41455 for branches/4.4/src/wp-includes/embed.php
- Timestamp:
- 09/19/2017 01:49:40 PM (9 years ago)
- Location:
- branches/4.4
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/wp-includes/embed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
-
branches/4.4/src/wp-includes/embed.php
r40164 r41455 775 775 $html = $content[1] . $content[2]; 776 776 777 preg_match( '/ src=([\'"])(.*?)\1/', $html, $results ); 778 779 if ( ! empty( $results ) ) { 780 $secret = wp_generate_password( 10, false ); 781 782 $url = esc_url( "{$results[2]}#?secret=$secret" ); 783 $q = $results[1]; 784 785 $html = str_replace( $results[0], ' src=' . $q . $url . $q . ' data-secret=' . $q . $secret . $q, $html ); 786 $html = str_replace( '<blockquote', "<blockquote data-secret=\"$secret\"", $html ); 787 } 788 789 $allowed_html['blockquote']['data-secret'] = true; 790 $allowed_html['iframe']['data-secret'] = true; 791 792 $html = wp_kses( $html, $allowed_html ); 793 777 794 if ( ! empty( $content[1] ) ) { 778 795 // We have a blockquote to fall back on. Hide the iframe by default. … … 781 798 } 782 799 783 $html = str_replace( '<iframe', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $html ); 784 785 preg_match( '/ src=[\'"]([^\'"]*)[\'"]/', $html, $results ); 786 787 if ( ! empty( $results ) ) { 788 $secret = wp_generate_password( 10, false ); 789 790 $url = esc_url( "{$results[1]}#?secret=$secret" ); 791 792 $html = str_replace( $results[0], " src=\"$url\" data-secret=\"$secret\"", $html ); 793 $html = str_replace( '<blockquote', "<blockquote data-secret=\"$secret\"", $html ); 794 } 800 $html = str_ireplace( '<iframe', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $html ); 795 801 796 802 return $html;
Note: See TracChangeset
for help on using the changeset viewer.