Changeset 43096 for branches/4.9
- Timestamp:
- 05/02/2018 02:34:57 AM (6 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
r43095 r43096 1986 1986 1987 1987 // Now, generate the ZIP. 1988 $error = false; 1988 1989 $archive_filename = $file_basename . '.zip'; 1989 1990 $archive_pathname = $exports_dir . $archive_filename; … … 1991 1992 1992 1993 $zip = new ZipArchive; 1993 1994 if ( TRUE === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) { 1995 $zip->addFile( $html_report_pathname, 'index.html' ); 1994 if ( true === $zip->open( $archive_pathname, ZipArchive::CREATE ) ) { 1995 if ( ! $zip->addFile( $html_report_pathname, 'index.html' ) ) { 1996 $error = __( 'Unable to add data to export file.' ); 1997 } 1998 1996 1999 $zip->close(); 2000 2001 if ( ! $error ) { 2002 /** 2003 * Fires right after all personal data has been written to the export file. 2004 * 2005 * @since 4.9.6 2006 * 2007 * @param string $archive_pathname The full path to the export file on the filesystem. 2008 * @param string $archive_url The URL of the archive file. 2009 * @param string $html_report_pathname The full path to the personal data report on the filesystem. 2010 */ 2011 do_action( 'wp_privacy_personal_data_export_file_created', $archive_pathname, $archive_url, $html_report_pathname ); 2012 } 1997 2013 } else { 1998 wp_send_json_error( __( 'Unable to open export file (archive) for writing' ));2014 $error = __( 'Unable to open export file (archive) for writing.' ); 1999 2015 } 2000 2016 2001 2017 // And remove the HTML file. 2002 2018 unlink( $html_report_pathname ); 2019 2020 if ( $error ) { 2021 wp_send_json_error( $error ); 2022 } 2003 2023 2004 2024 // Save the export file in the request.
Note: See TracChangeset
for help on using the changeset viewer.