Changeset 39719
- Timestamp:
- 01/05/2017 04:25:43 PM (8 years ago)
- Location:
- branches/3.7
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7
- Property svn:mergeinfo changed
/branches/4.6 (added) merged: 38615
- Property svn:mergeinfo changed
-
branches/3.7/src
- Property svn:mergeinfo changed
/branches/4.6/src (added) merged: 38615
- Property svn:mergeinfo changed
-
branches/3.7/src/wp-admin/includes/media.php
r38548 r39719 222 222 $type = $file['type']; 223 223 $file = $file['file']; 224 $title = sanitize_t itle( $name );224 $title = sanitize_text_field( $name ); 225 225 $content = ''; 226 226 -
branches/3.7/tests/phpunit/tests/media.php
r33525 r39719 349 349 350 350 /** 351 * @ticket 37989 352 */ 353 public function test_media_handle_upload_expected_titles() { 354 $test_file = DIR_TESTDATA . '/images/test-image.jpg'; 355 356 // Make a copy of this file as it gets moved during the file upload 357 $tmp_name = wp_tempnam( $test_file ); 358 359 copy( $test_file, $tmp_name ); 360 361 $_FILES['upload'] = array( 362 'tmp_name' => $tmp_name, 363 'name' => 'This is a test.jpg', 364 'type' => 'image/jpeg', 365 'error' => 0, 366 'size' => filesize( $test_file ), 367 ); 368 369 $post_id = media_handle_upload( 'upload', 0, array(), array( 'action' => 'test_upload_titles', 'test_form' => false ) ); 370 371 unset( $_FILES['upload'] ); 372 373 $post = get_post( $post_id ); 374 375 // Clean up. 376 wp_delete_attachment( $post_id ); 377 378 $this->assertEquals( 'This is a test', $post->post_title ); 379 } 380 381 /** 351 382 * @ticket 33016 352 383 */
Note: See TracChangeset
for help on using the changeset viewer.