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

git-svn-id: https://develop.svn.wordpress.org/trunk@19881 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jon Cave 2012-02-08 20:55:18 +00:00
parent 7e305ea285
commit 1f9b62bf85
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 ( $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