Changeset 55223
- Timestamp:
- 02/04/2023 03:35:29 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r55219 r55223 1972 1972 1973 1973 if ( trailingslashit( strtolower( $from ) ) === trailingslashit( strtolower( $to ) ) ) { 1974 return new WP_Error( 1975 'source_destination_same_move_dir', 1976 __( 'The source and destination are the same.' ) 1977 ); 1978 } 1979 1980 if ( ! $overwrite && $wp_filesystem->exists( $to ) ) { 1981 return new WP_Error( 'destination_already_exists_move_dir', __( 'The destination folder already exists.' ), $to ); 1982 } 1983 1984 if ( $overwrite && $wp_filesystem->exists( $to ) && ! $wp_filesystem->delete( $to, true ) ) { 1985 // Can't overwrite if the destination couldn't be deleted. 1986 return WP_Error( 'destination_not_deleted_move_dir', __( 'The destination directory already exists and could not be removed.' ) ); 1974 return new WP_Error( 'source_destination_same_move_dir', __( 'The source and destination are the same.' ) ); 1975 } 1976 1977 if ( $wp_filesystem->exists( $to ) ) { 1978 if ( ! $overwrite ) { 1979 return new WP_Error( 'destination_already_exists_move_dir', __( 'The destination folder already exists.' ), $to ); 1980 } elseif ( ! $wp_filesystem->delete( $to, true ) ) { 1981 // Can't overwrite if the destination couldn't be deleted. 1982 return WP_Error( 'destination_not_deleted_move_dir', __( 'The destination directory already exists and could not be removed.' ) ); 1983 } 1987 1984 } 1988 1985
Note: See TracChangeset
for help on using the changeset viewer.