Changeset 24623
- Timestamp:
- 07/10/2013 03:34:35 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-xmlrpc-server.php
r24597 r24623 4315 4315 } 4316 4316 4317 function add_enclosure_if_new( $post_ID, $enclosure) {4317 function add_enclosure_if_new( $post_ID, $enclosure ) { 4318 4318 if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) { 4319 4320 $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type']; 4319 $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] . "\n"; 4321 4320 $found = false; 4322 foreach ( (array) get_post_custom($post_ID) as $key => $val) { 4323 if ($key == 'enclosure') { 4324 foreach ( (array) $val as $enc ) { 4325 if ($enc == $encstring) { 4326 $found = true; 4327 break 2; 4328 } 4321 if ( $enclosures = get_post_meta( $post_ID, 'enclosure' ) ) { 4322 foreach ( $enclosures as $enc ) { 4323 // This method used to omit the trailing new line. #23219 4324 if ( rtrim( $enc, "\n" ) == rtrim( $encstring, "\n" ) ) { 4325 $found = true; 4326 break; 4329 4327 } 4330 4328 } 4331 4329 } 4332 if ( !$found)4330 if ( ! $found ) 4333 4331 add_post_meta( $post_ID, 'enclosure', $encstring ); 4334 4332 }
Note: See TracChangeset
for help on using the changeset viewer.