Ticket #26675: 26675-2014.02.19.patch
File 26675-2014.02.19.patch, 1.1 KB (added by , 11 years ago) |
---|
-
wp-includes/media.php
2133 2133 */ 2134 2134 function get_media_embedded_in_content( $content, $types = null ) { 2135 2135 $html = array(); 2136 $allowed_media_types = array( 'audio', 'video', 'object', 'embed', 'iframe' ); 2136 2137 $allowed_media_types = apply_filters( 'get_media_embedded_in_content_allowed', array( 'audio', 'video', 'object', 'embed', 'iframe' ) ); 2138 2137 2139 if ( ! empty( $types ) ) { 2138 if ( ! is_array( $types ) ) 2140 if ( ! is_array( $types ) ) { 2139 2141 $types = array( $types ); 2142 } 2143 2140 2144 $allowed_media_types = array_intersect( $allowed_media_types, $types ); 2141 2145 } 2142 2146 2143 foreach ( $allowed_media_types as $tag ) { 2144 if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $content, $matches ) ) { 2145 $html[] = $matches[0]; 2147 $tags = implode( '|', $allowed_media_types ); 2148 2149 if ( preg_match_all( '#<(?P<tag>' . $tags . ')[^<]*?(?:>[\s\S]*?<\/(?P=tag)>|\s*\/>)#', $content, $matches ) ) { 2150 foreach ( $matches[0] as $match ) { 2151 $html[] = $match; 2146 2152 } 2147 2153 }