Changeset 61374 for trunk/src/wp-admin/includes/file.php
- Timestamp:
- 12/13/2025 08:10:50 PM (6 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/file.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r60309 r61374 1897 1897 1898 1898 // Determine any children directories needed (From within the archive). 1899 foreach ( $archive_files as $ file ) {1900 if ( str_starts_with( $ file['filename'], '__MACOSX/' ) ) { // Skip the OS X-created __MACOSX directory.1899 foreach ( $archive_files as $archive_file ) { 1900 if ( str_starts_with( $archive_file['filename'], '__MACOSX/' ) ) { // Skip the OS X-created __MACOSX directory. 1901 1901 continue; 1902 1902 } 1903 1903 1904 $uncompressed_size += $ file['size'];1905 1906 $needed_dirs[] = $to . untrailingslashit( $ file['folder'] ? $file['filename'] : dirname( $file['filename'] ) );1904 $uncompressed_size += $archive_file['size']; 1905 1906 $needed_dirs[] = $to . untrailingslashit( $archive_file['folder'] ? $archive_file['filename'] : dirname( $archive_file['filename'] ) ); 1907 1907 } 1908 1908 … … 1968 1968 1969 1969 // Extract the files from the zip. 1970 foreach ( $archive_files as $ file ) {1971 if ( $ file['folder'] ) {1970 foreach ( $archive_files as $archive_file ) { 1971 if ( $archive_file['folder'] ) { 1972 1972 continue; 1973 1973 } 1974 1975 if ( str_starts_with( $ file['filename'], '__MACOSX/' ) ) { // Don't extract the OS X-created __MACOSX directory files.1974 1975 if ( str_starts_with( $archive_file['filename'], '__MACOSX/' ) ) { // Don't extract the OS X-created __MACOSX directory files. 1976 1976 continue; 1977 1977 } 1978 1978 1979 1979 // Don't extract invalid files: 1980 if ( 0 !== validate_file( $ file['filename'] ) ) {1980 if ( 0 !== validate_file( $archive_file['filename'] ) ) { 1981 1981 continue; 1982 1982 } 1983 1983 1984 if ( ! $wp_filesystem->put_contents( $to . $ file['filename'], $file['content'], FS_CHMOD_FILE ) ) {1985 return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $ file['filename'] );1984 if ( ! $wp_filesystem->put_contents( $to . $archive_file['filename'], $archive_file['content'], FS_CHMOD_FILE ) ) { 1985 return new WP_Error( 'copy_failed_pclzip', __( 'Could not copy file.' ), $archive_file['filename'] ); 1986 1986 } 1987 1987 }
Note: See TracChangeset
for help on using the changeset viewer.