Changeset 2560
- Timestamp:
- 04/20/2005 09:07:19 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r2551 r2560 811 811 812 812 foreach ($post_links as $url) : 813 if ( $url != '' && in_array($url, $pung) == false) {813 if ( $url != '' && !$wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE post_id = '$post_ID' AND meta_key = 'enclosure' AND meta_value LIKE ('$url%')") ) { 814 814 if ( $headers = wp_get_http_headers( $url) ) { 815 $len = $headers['content-length'];816 $type = $headers['content-type'];815 $len = (int) $headers['content-length']; 816 $type = addslashes( $headers['content-type'] ); 817 817 $allowed_types = array( 'video', 'audio' ); 818 818 if( in_array( substr( $type, 0, strpos( $type, "/" ) ), $allowed_types ) ) { 819 819 $meta_value = "$url\n$len\n$type\n"; 820 $wpdb->query( "INSERT INTO ` ".$wpdb->postmeta."` ( `post_id` , `meta_key` , `meta_value` )821 VALUES ( '$post_ID', 'enclosure' , ' ".$meta_value."')" );820 $wpdb->query( "INSERT INTO `$wpdb->postmeta` ( `post_id` , `meta_key` , `meta_value` ) 821 VALUES ( '$post_ID', 'enclosure' , '$meta_value')" ); 822 822 } 823 823 }
Note: See TracChangeset
for help on using the changeset viewer.