Changeset 24464 for branches/3.5/wp-admin/includes/file.php
- Timestamp:
- 06/21/2013 02:31:39 AM (12 years ago)
- Location:
- branches/3.5
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
wp-admin/includes/file.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.5
-
branches/3.5/wp-admin/includes/file.php
r22800 r24464 329 329 // Move the file to the uploads dir 330 330 $new_file = $uploads['path'] . "/$filename"; 331 if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) 332 return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) ); 331 if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file ) ) { 332 if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) 333 $error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir']; 334 else 335 $error_path = basename( $uploads['basedir'] ) . $uploads['subdir']; 336 337 return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $error_path ) ); 338 } 333 339 334 340 // Set correct file permissions … … 453 459 $new_file = $uploads['path'] . "/$filename"; 454 460 if ( false === @ rename( $file['tmp_name'], $new_file ) ) { 455 return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) ); 461 if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) 462 $error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir']; 463 else 464 $error_path = basename( $uploads['basedir'] ) . $uploads['subdir']; 465 return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $error_path ) ); 456 466 } 457 467
Note: See TracChangeset
for help on using the changeset viewer.