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:
parent
7e305ea285
commit
1f9b62bf85
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue