Changeset 31239
- Timestamp:
- 01/18/2015 08:32:50 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r31168 r31239 3296 3296 * 3297 3297 * @param string $url The URL to resolve. 3298 * @return int The found post ID .3298 * @return int The found post ID, or 0 on failure. 3299 3299 */ 3300 3300 function attachment_url_to_postid( $url ) { … … 3313 3313 ); 3314 3314 $post_id = $wpdb->get_var( $sql ); 3315 if ( ! empty( $post_id ) ) { 3316 return (int) $post_id; 3317 } 3315 3316 return (int) $post_id; 3318 3317 } 3319 3318 -
trunk/tests/phpunit/tests/media.php
r31066 r31239 502 502 } 503 503 504 /** 505 * @ticket 31044 506 */ 507 function test_attachment_url_to_postid_with_empty_url() { 508 $post_id = attachment_url_to_postid( '' ); 509 $this->assertInternalType( 'int', $post_id ); 510 $this->assertEquals( 0, $post_id ); 511 } 512 504 513 function test_wp_check_filetype() { 505 514 $url = 'http://example.com/testFile.mp4?autoplay=true&otherstuff=false';
Note: See TracChangeset
for help on using the changeset viewer.