Changeset 29206 for trunk/src/wp-admin/includes/file.php
- Timestamp:
- 07/17/2014 09:13:53 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r28893 r29206 180 180 wp_die( __( 'Sorry, that file cannot be edited.' ) ); 181 181 182 // case 2 :183 // 182 // case 2 : 183 // wp_die( __('Sorry, can’t call files with their real path.' )); 184 184 185 185 case 3 : … … 258 258 __( "File upload stopped by extension." )); 259 259 260 // this may not have orignially been intended to be overrideable, but historically has been 260 /* 261 * This may not have orignially been intended to be overrideable, 262 * but historically has been. 263 */ 261 264 if ( isset( $overrides['upload_error_strings'] ) ) { 262 265 $upload_error_strings = $overrides['upload_error_strings']; … … 268 271 $test_upload = isset( $overrides['test_upload'] ) ? $overrides['test_upload'] : true; 269 272 270 // If you override this, you must provide $ext and $type!! !!273 // If you override this, you must provide $ext and $type!! 271 274 $test_type = isset( $overrides['test_type'] ) ? $overrides['test_type'] : true; 272 275 $mimes = isset( $overrides['mimes'] ) ? $overrides['mimes'] : false; … … 315 318 } 316 319 317 // A writable uploads dir will pass this test. Again, there's no point overriding this one. 320 /* 321 * A writable uploads dir will pass this test. Again, there's no point 322 * overriding this one. 323 */ 318 324 if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) ) 319 325 return call_user_func($upload_error_handler, $file, $uploads['error'] ); … … 321 327 $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); 322 328 323 // Move the file to the uploads dir 329 // Move the file to the uploads dir. 324 330 $new_file = $uploads['path'] . "/$filename"; 325 331 if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) { … … 332 338 } 333 339 334 // Set correct file permissions 340 // Set correct file permissions. 335 341 $stat = stat( dirname( $new_file )); 336 342 $perms = $stat['mode'] & 0000666; 337 343 @ chmod( $new_file, $perms ); 338 344 339 // Compute the URL 345 // Compute the URL. 340 346 $url = $uploads['url'] . "/$filename"; 341 347 … … 1052 1058 $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? wp_unslash( $_POST['private_key'] ) : ''); 1053 1059 1054 // sanitize the hostname, Some people might pass in odd-data:1060 // Sanitize the hostname, Some people might pass in odd-data: 1055 1061 $credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off 1056 1062
Note: See TracChangeset
for help on using the changeset viewer.