Changeset 49090 for trunk/src/wp-includes/user.php
- Timestamp:
- 10/04/2020 03:21:38 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r49036 r49090 3613 3613 3614 3614 if ( $requests_query->found_posts ) { 3615 return new WP_Error( 'duplicate_request', __( 'An incomplete request for this email address already exists.' ) );3615 return new WP_Error( 'duplicate_request', __( 'An incomplete user privacy request for this email address already exists.' ) ); 3616 3616 } 3617 3617 … … 3681 3681 3682 3682 if ( ! $request ) { 3683 return new WP_Error( 'invalid_request', __( 'Invalid user request.' ) );3683 return new WP_Error( 'invalid_request', __( 'Invalid user privacy request.' ) ); 3684 3684 } 3685 3685 … … 3863 3863 global $wp_hasher; 3864 3864 3865 $request_id = absint( $request_id ); 3866 $request = wp_get_user_request( $request_id ); 3867 3868 if ( ! $request ) { 3869 return new WP_Error( 'invalid_request', __( 'Invalid request.' ) ); 3865 $request_id = absint( $request_id ); 3866 $request = wp_get_user_request( $request_id ); 3867 $saved_key = $request->confirm_key; 3868 $key_request_time = $request->modified_timestamp; 3869 3870 if ( ! $request || ! $saved_key || ! $key_request_time ) { 3871 return new WP_Error( 'invalid_request', __( 'Invalid user privacy request.' ) ); 3870 3872 } 3871 3873 3872 3874 if ( ! in_array( $request->status, array( 'request-pending', 'request-failed' ), true ) ) { 3873 return new WP_Error( 'expired_ link', __( 'This linkhas expired.' ) );3875 return new WP_Error( 'expired_request', __( 'This user privacy request has expired.' ) ); 3874 3876 } 3875 3877 3876 3878 if ( empty( $key ) ) { 3877 return new WP_Error( 'missing_key', __( ' Missing confirmkey.' ) );3879 return new WP_Error( 'missing_key', __( 'This user privacy request is missing the confirmation key.' ) ); 3878 3880 } 3879 3881 … … 3883 3885 } 3884 3886 3885 $key_request_time = $request->modified_timestamp;3886 $saved_key = $request->confirm_key;3887 3888 if ( ! $saved_key ) {3889 return new WP_Error( 'invalid_key', __( 'Invalid key.' ) );3890 }3891 3892 if ( ! $key_request_time ) {3893 return new WP_Error( 'invalid_key', __( 'Invalid action.' ) );3894 }3895 3896 3887 /** 3897 3888 * Filters the expiration time of confirm keys. … … 3905 3896 3906 3897 if ( ! $wp_hasher->CheckPassword( $key, $saved_key ) ) { 3907 return new WP_Error( 'invalid_key', __( ' Invalid key.' ) );3898 return new WP_Error( 'invalid_key', __( 'This user privacy request confirmation key is invalid.' ) ); 3908 3899 } 3909 3900 3910 3901 if ( ! $expiration_time || time() > $expiration_time ) { 3911 return new WP_Error( 'expired_key', __( 'Th e confirmation emailhas expired.' ) );3902 return new WP_Error( 'expired_key', __( 'This user privacy request confirmation key has expired.' ) ); 3912 3903 } 3913 3904
Note: See TracChangeset
for help on using the changeset viewer.