Changeset 43180
- Timestamp:
- 05/08/2018 12:51:59 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r43154 r43180 2128 2128 fclose( $file ); 2129 2129 2130 // Now, generate the ZIP. 2130 /* 2131 * Now, generate the ZIP. 2132 * 2133 * If an archive has already been generated, then remove it and reuse the 2134 * filename, to avoid breaking any URLs that may have been previously sent 2135 * via email. 2136 */ 2131 2137 $error = false; 2132 $archive_filename = $file_basename . '.zip'; 2133 $archive_pathname = $exports_dir . $archive_filename; 2134 $archive_url = $exports_url . $archive_filename; 2138 $archive_url = get_post_meta( $request_id, '_export_file_url', true ); 2139 $archive_pathname = get_post_meta( $request_id, '_export_file_path', true ); 2140 2141 if ( empty( $archive_pathname ) || empty( $archive_url ) ) { 2142 $archive_filename = $file_basename . '.zip'; 2143 $archive_pathname = $exports_dir . $archive_filename; 2144 $archive_url = $exports_url . $archive_filename; 2145 2146 update_post_meta( $request_id, '_export_file_url', $archive_url ); 2147 update_post_meta( $request_id, '_export_file_path', $archive_pathname ); 2148 } 2149 2150 if ( ! empty( $archive_pathname ) && file_exists( $archive_pathname ) ) { 2151 wp_delete_file( $archive_pathname ); 2152 } 2135 2153 2136 2154 $zip = new ZipArchive; … … 2164 2182 wp_send_json_error( $error ); 2165 2183 } 2166 2167 // Save the export file in the request.2168 update_post_meta( $request_id, '_export_file_url', $archive_url );2169 update_post_meta( $request_id, '_export_file_path', $archive_pathname );2170 2184 } 2171 2185 … … 2343 2357 update_post_meta( $request_id, '_export_data_grouped', $groups ); 2344 2358 2345 // And now, generate the export file, cleaning up any previous file2346 $export_path = get_post_meta( $request_id, '_export_file_path', true );2347 if ( ! empty( $export_path ) ) {2348 delete_post_meta( $request_id, '_export_file_path' );2349 @unlink( $export_path );2350 }2351 delete_post_meta( $request_id, '_export_file_url' );2352 2353 2359 // Generate the export file from the collected, grouped personal data. 2354 2360 do_action( 'wp_privacy_personal_data_export_file', $request_id );
Note: See TracChangeset
for help on using the changeset viewer.