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:
parent
d06722b8ac
commit
6025a35ccf
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue