Skip to:
Content

BuddyPress.org

Ticket #8858: 8858.01.patch

File 8858.01.patch, 1.4 KB (added by r-a-y, 14 months ago)
  • src/bp-settings/bp-settings-functions.php

     
    263263 * @return string Formatted date.
    264264 */
    265265function 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 */
    267267        $expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
    268268
    269269        return bp_format_time( $request->completed_timestamp + $expiration, true );
     
    290290 * @return string Export file URL.
    291291 */
    292292function 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;
    294299}
    295300
    296301/**
     
    302307 * @return bool
    303308 */
    304309function 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 );
    307316}
    308317
    309318/**