WordPress.org

Make WordPress Core

Ticket #44151: 44151.3.patch

File 44151.3.patch, 746 bytes (added by robobot3000, 20 months ago)

Always append the new data to the result array

  • wp-admin/includes/file.php

     
    23472347                        $groups[ $group_id ]['items'][ $item_id ] = array();
    23482348                }
    23492349
    2350                 $old_item_data = $groups[ $group_id ]['items'][ $item_id ];
    2351                 $merged_item_data = array_merge( $export_datum['data'], $old_item_data );
     2350                $merged_item_data = $groups[ $group_id ]['items'][ $item_id ];
     2351                //append the new data, but don't overwrite the data that has already been collected
     2352                foreach ( $export_datum['data'] as $new_value ) {
     2353                        $merged_item_data[] = $new_value;
     2354                }
     2355
    23522356                $groups[ $group_id ]['items'][ $item_id ] = $merged_item_data;
    23532357        }
    23542358