Ticket #8858: 8858.01.patch
File 8858.01.patch, 1.4 KB (added by , 8 months ago) |
---|
-
src/bp-settings/bp-settings-functions.php
263 263 * @return string Formatted date. 264 264 */ 265 265 function bp_settings_get_personal_data_expiration_date( WP_User_Request $request ) { 266 /** This filter is documented in wp- admin/includes/file.php */266 /** This filter is documented in wp-includes/functions.php */ 267 267 $expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS ); 268 268 269 269 return bp_format_time( $request->completed_timestamp + $expiration, true ); … … 290 290 * @return string Export file URL. 291 291 */ 292 292 function bp_settings_get_personal_data_export_url( WP_User_Request $request ) { 293 return get_post_meta( $request->ID, '_export_file_url', true ); 293 if ( ! bp_settings_personal_data_export_exists( $request ) ) { 294 return ''; 295 } 296 297 $file = get_post_meta( $request->ID, '_export_file_name', true ); 298 return wp_privacy_exports_url() . $file; 294 299 } 295 300 296 301 /** … … 302 307 * @return bool 303 308 */ 304 309 function bp_settings_personal_data_export_exists( WP_User_Request $request ) { 305 $file = get_post_meta( $request->ID, '_export_file_path', true ); 306 return file_exists( $file ); 310 $file = get_post_meta( $request->ID, '_export_file_name', true ); 311 if ( empty( $file ) ) { 312 return false; 313 } 314 315 return file_exists( wp_privacy_exports_dir() . $file ); 307 316 } 308 317 309 318 /**