Changeset 39712
- Timestamp:
- 01/05/2017 04:14:39 PM (8 years ago)
- Location:
- branches/4.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
- Property svn:mergeinfo changed
/branches/4.6 (added) merged: 38615
- Property svn:mergeinfo changed
-
branches/4.4/src/wp-admin/includes/media.php
r38541 r39712 287 287 $type = $file['type']; 288 288 $file = $file['file']; 289 $title = sanitize_t itle( $name );289 $title = sanitize_text_field( $name ); 290 290 $content = ''; 291 291 $excerpt = ''; -
branches/4.4/tests/phpunit/tests/media.php
r36152 r39712 590 590 591 591 $this->assertEquals( 'This is a comment. / Это комментарий. / Βλέπετε ένα σχόλιο.', $post->post_excerpt ); 592 } 593 594 /** 595 * @ticket 37989 596 */ 597 public function test_media_handle_upload_expected_titles() { 598 $test_file = DIR_TESTDATA . '/images/test-image.jpg'; 599 600 // Make a copy of this file as it gets moved during the file upload 601 $tmp_name = wp_tempnam( $test_file ); 602 603 copy( $test_file, $tmp_name ); 604 605 $_FILES['upload'] = array( 606 'tmp_name' => $tmp_name, 607 'name' => 'This is a test.jpg', 608 'type' => 'image/jpeg', 609 'error' => 0, 610 'size' => filesize( $test_file ), 611 ); 612 613 $post_id = media_handle_upload( 'upload', 0, array(), array( 'action' => 'test_upload_titles', 'test_form' => false ) ); 614 615 unset( $_FILES['upload'] ); 616 617 $post = get_post( $post_id ); 618 619 // Clean up. 620 wp_delete_attachment( $post_id ); 621 622 $this->assertEquals( 'This is a test', $post->post_title ); 592 623 } 593 624
Note: See TracChangeset
for help on using the changeset viewer.