Changeset 43186
- Timestamp:
- 05/09/2018 02:29:25 PM (7 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-admin/includes/file.php
r43157 r43186 1991 1991 fclose( $file ); 1992 1992 1993 // Now, generate the ZIP. 1993 /* 1994 * Now, generate the ZIP. 1995 * 1996 * If an archive has already been generated, then remove it and reuse the 1997 * filename, to avoid breaking any URLs that may have been previously sent 1998 * via email. 1999 */ 1994 2000 $error = false; 1995 $archive_filename = $file_basename . '.zip'; 1996 $archive_pathname = $exports_dir . $archive_filename; 1997 $archive_url = $exports_url . $archive_filename; 2001 $archive_url = get_post_meta( $request_id, '_export_file_url', true ); 2002 $archive_pathname = get_post_meta( $request_id, '_export_file_path', true ); 2003 2004 if ( empty( $archive_pathname ) || empty( $archive_url ) ) { 2005 $archive_filename = $file_basename . '.zip'; 2006 $archive_pathname = $exports_dir . $archive_filename; 2007 $archive_url = $exports_url . $archive_filename; 2008 2009 update_post_meta( $request_id, '_export_file_url', $archive_url ); 2010 update_post_meta( $request_id, '_export_file_path', $archive_pathname ); 2011 } 2012 2013 if ( ! empty( $archive_pathname ) && file_exists( $archive_pathname ) ) { 2014 wp_delete_file( $archive_pathname ); 2015 } 1998 2016 1999 2017 $zip = new ZipArchive; … … 2027 2045 wp_send_json_error( $error ); 2028 2046 } 2029 2030 // Save the export file in the request.2031 update_post_meta( $request_id, '_export_file_url', $archive_url );2032 update_post_meta( $request_id, '_export_file_path', $archive_pathname );2033 2047 } 2034 2048 … … 2206 2220 update_post_meta( $request_id, '_export_data_grouped', $groups ); 2207 2221 2208 // And now, generate the export file, cleaning up any previous file2209 $export_path = get_post_meta( $request_id, '_export_file_path', true );2210 if ( ! empty( $export_path ) ) {2211 delete_post_meta( $request_id, '_export_file_path' );2212 @unlink( $export_path );2213 }2214 delete_post_meta( $request_id, '_export_file_url' );2215 2216 2222 // Generate the export file from the collected, grouped personal data. 2217 2223 do_action( 'wp_privacy_personal_data_export_file', $request_id );
Note: See TracChangeset
for help on using the changeset viewer.