Prevent undefined index notices in do_enclose(). Props jeremyclarke. Fixes #19865.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
duck_ 2012-02-08 20:55:18 +00:00
parent d06722b8ac
commit 6025a35ccf
1 changed files with 2 additions and 2 deletions

View File

@ -521,8 +521,8 @@ function do_enclose( $content, $post_ID ) {
if ( $url != '' && !$wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, like_escape( $url ) . '%' ) ) ) { if ( $url != '' && !$wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, like_escape( $url ) . '%' ) ) ) {
if ( $headers = wp_get_http_headers( $url) ) { if ( $headers = wp_get_http_headers( $url) ) {
$len = (int) $headers['content-length']; $len = isset( $headers['content-length'] ) ? (int) $headers['content-length'] : 0;
$type = $headers['content-type']; $type = isset( $headers['content-type'] ) ? $headers['content-type'] : '';
$allowed_types = array( 'video', 'audio' ); $allowed_types = array( 'video', 'audio' );
// Check to see if we can figure out the mime type from // Check to see if we can figure out the mime type from