Changeset 28451 for trunk/src/wp-admin/includes/file.php
- Timestamp:
- 05/16/2014 04:14:56 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r28450 r28451 385 385 } 386 386 387 // Install user overrides. Did we mention that this voids your warranty? 388 387 389 // You may define your own function and pass the name in $overrides['upload_error_handler'] 388 390 $upload_error_handler = 'wp_handle_upload_error'; 391 if ( isset( $overrides['upload_error_handler'] ) ) { 392 $upload_error_handler = $overrides['upload_error_handler']; 393 } 389 394 390 395 // You may define your own function and pass the name in $overrides['unique_filename_callback'] 391 396 $unique_filename_callback = null; 397 if ( isset( $overrides['unique_filename_callback'] ) ) { 398 $unique_filename_callback = $overrides['unique_filename_callback']; 399 } 392 400 393 401 // $_POST['action'] must be set and its value must equal $overrides['action'] or this: 394 402 $action = 'wp_handle_sideload'; 403 if ( isset( $overrides['action'] ) ) { 404 $action = $overrides['action']; 405 } 395 406 396 407 // Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error']. … … 405 416 __( "File upload stopped by extension." )); 406 417 418 // this may not have orignially been intended to be overrideable, but historically has been 419 if ( isset( $overrides['upload_error_strings'] ) ) { 420 $upload_error_strings = $overrides['upload_error_strings']; 421 } 422 407 423 // All tests are on by default. Most can be turned off by $overrides[{test_name}] = false; 408 $test_form = true;409 $test_size = true;424 $test_form = isset( $overrides['test_form'] ) ? $overrides['test_form'] : true; 425 $test_size = isset( $overrides['test_size'] ) ? $overrides['test_size'] : true; 410 426 411 427 // If you override this, you must provide $ext and $type!!!! 412 $test_type = true; 413 $mimes = false; 414 415 // Install user overrides. Did we mention that this voids your warranty? 416 if ( is_array( $overrides ) ) 417 extract( $overrides, EXTR_OVERWRITE ); 428 $test_type = isset( $overrides['test_type'] ) ? $overrides['test_type'] : true; 429 $mimes = isset( $overrides['mimes'] ) ? $overrides['mimes'] : false; 418 430 419 431 // A correct form post will pass this test. … … 450 462 $type = $file['type']; 451 463 } 464 } else { 465 $type = ''; 452 466 } 453 467
Note: See TracChangeset
for help on using the changeset viewer.