From 6025a35ccfa9475fe705731b4e51e689ba29a480 Mon Sep 17 00:00:00 2001 From: duck_ Date: Wed, 8 Feb 2012 20:55:18 +0000 Subject: [PATCH] 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 --- wp-includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 1a674d316..50df62131 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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 ( $headers = wp_get_http_headers( $url) ) { - $len = (int) $headers['content-length']; - $type = $headers['content-type']; + $len = isset( $headers['content-length'] ) ? (int) $headers['content-length'] : 0; + $type = isset( $headers['content-type'] ) ? $headers['content-type'] : ''; $allowed_types = array( 'video', 'audio' ); // Check to see if we can figure out the mime type from