Changeset 39717
- Timestamp:
- 01/05/2017 04:20:40 PM (8 years ago)
- Location:
- branches/3.9
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9
- Property svn:mergeinfo changed
/branches/4.6 (added) merged: 38615
- Property svn:mergeinfo changed
-
branches/3.9/src/wp-admin/includes/media.php
r38546 r39717 263 263 $type = $file['type']; 264 264 $file = $file['file']; 265 $title = sanitize_t itle( $name );265 $title = sanitize_text_field( $name ); 266 266 $content = ''; 267 267 -
branches/3.9/tests/phpunit/tests/media.php
r33523 r39717 439 439 440 440 /** 441 * @ticket 37989 442 */ 443 public function test_media_handle_upload_expected_titles() { 444 $test_file = DIR_TESTDATA . '/images/test-image.jpg'; 445 446 // Make a copy of this file as it gets moved during the file upload 447 $tmp_name = wp_tempnam( $test_file ); 448 449 copy( $test_file, $tmp_name ); 450 451 $_FILES['upload'] = array( 452 'tmp_name' => $tmp_name, 453 'name' => 'This is a test.jpg', 454 'type' => 'image/jpeg', 455 'error' => 0, 456 'size' => filesize( $test_file ), 457 ); 458 459 $post_id = media_handle_upload( 'upload', 0, array(), array( 'action' => 'test_upload_titles', 'test_form' => false ) ); 460 461 unset( $_FILES['upload'] ); 462 463 $post = get_post( $post_id ); 464 465 // Clean up. 466 wp_delete_attachment( $post_id ); 467 468 $this->assertEquals( 'This is a test', $post->post_title ); 469 } 470 471 /** 441 472 * @ticket 33016 442 473 */
Note: See TracChangeset
for help on using the changeset viewer.