Changeset 25540 for trunk/src/wp-admin/includes/file.php
- Timestamp:
- 09/21/2013 06:48:20 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r25469 r25540 724 724 $to = trailingslashit($to); 725 725 726 $skip_regex = '';727 foreach ( (array)$skip_list as $key => $skip_file )728 $skip_regex .= preg_quote($skip_file, '!') . '|';729 730 if ( !empty($skip_regex) )731 $skip_regex = '!(' . rtrim($skip_regex, '|') . ')$!i';732 733 726 foreach ( (array) $dirlist as $filename => $fileinfo ) { 734 if ( !empty($skip_regex) ) 735 if ( preg_match($skip_regex, $from . $filename) ) 736 continue; 727 if ( in_array( $filename, $skip_list ) ) 728 continue; 737 729 738 730 if ( 'f' == $fileinfo['type'] ) { … … 748 740 return new WP_Error('mkdir_failed', __('Could not create directory.'), $to . $filename); 749 741 } 750 $result = copy_dir($from . $filename, $to . $filename, $skip_list); 742 743 // generate the $sub_skip_list for the subdirectory as a sub-set of the existing $skip_list 744 $sub_skip_list = array(); 745 foreach ( $skip_list as $skip_item ) { 746 if ( 0 === strpos( $skip_item, $filename . '/' ) ) 747 $sub_skip_list[] = preg_replace( '!^' . preg_quote( $filename, '!' ) . '/!i', '', $skip_item ); 748 } 749 750 $result = copy_dir($from . $filename, $to . $filename, $sub_skip_list); 751 751 if ( is_wp_error($result) ) 752 752 return $result;
Note: See TracChangeset
for help on using the changeset viewer.