Changeset 43571 for trunk/src/wp-includes/user.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r43568 r43571 910 910 INNER JOIN {$wpdb->users} ON user_id = ID 911 911 WHERE meta_key = '{$blog_prefix}capabilities' 912 ", ARRAY_N 912 ", 913 ARRAY_N 913 914 ); 914 915 … … 2607 2608 WHERE meta_key = '{$prefix}capabilities' 2608 2609 AND meta_value NOT REGEXP %s 2609 ", $regex 2610 ", 2611 $regex 2610 2612 ) 2611 2613 ); … … 2708 2710 if ( ! is_email( $_POST['email'] ) ) { 2709 2711 $errors->add( 2710 'user_email', __( '<strong>ERROR</strong>: The email address isn’t correct.' ), array( 2712 'user_email', 2713 __( '<strong>ERROR</strong>: The email address isn’t correct.' ), 2714 array( 2711 2715 'form-field' => 'email', 2712 2716 ) … … 2718 2722 if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST['email'] ) ) ) { 2719 2723 $errors->add( 2720 'user_email', __( '<strong>ERROR</strong>: The email address is already used.' ), array( 2724 'user_email', 2725 __( '<strong>ERROR</strong>: The email address is already used.' ), 2726 array( 2721 2727 'form-field' => 'email', 2722 2728 ) … … 2941 2947 2942 2948 update_post_meta( $request_id, '_wp_user_request_confirmed_timestamp', time() ); 2943 wp_update_post( array( 2944 'ID' => $request_id, 2945 'post_status' => 'request-confirmed', 2946 ) ); 2949 wp_update_post( 2950 array( 2951 'ID' => $request_id, 2952 'post_status' => 'request-confirmed', 2953 ) 2954 ); 2947 2955 } 2948 2956 … … 3127 3135 ); 3128 3136 3129 $subject 3137 $subject = sprintf( 3130 3138 /* translators: %s: Site name. */ 3131 3139 __( '[%s] Erasure Request Fulfilled' ), … … 3236 3244 $request = wp_get_user_request_data( $request_id ); 3237 3245 3238 $message = '<p class="success">' . __( 'Action has been confirmed.' ) . '</p>';3246 $message = '<p class="success">' . __( 'Action has been confirmed.' ) . '</p>'; 3239 3247 $message .= '<p>' . __( 'The site administrator has been notified and will fulfill your request as soon as possible.' ) . '</p>'; 3240 3248 3241 3249 if ( $request && in_array( $request->action_name, _wp_privacy_action_request_types(), true ) ) { 3242 3250 if ( 'export_personal_data' === $request->action_name ) { 3243 $message = '<p class="success">' . __( 'Thanks for confirming your export request.' ) . '</p>';3251 $message = '<p class="success">' . __( 'Thanks for confirming your export request.' ) . '</p>'; 3244 3252 $message .= '<p>' . __( 'The site administrator has been notified. You will receive a link to download your export via email when they fulfill your request.' ) . '</p>'; 3245 3253 } elseif ( 'remove_personal_data' === $request->action_name ) { 3246 $message = '<p class="success">' . __( 'Thanks for confirming your erasure request.' ) . '</p>';3254 $message = '<p class="success">' . __( 'Thanks for confirming your erasure request.' ) . '</p>'; 3247 3255 $message .= '<p>' . __( 'The site administrator has been notified. You will receive an email confirmation when they erase your data.' ) . '</p>'; 3248 3256 } … … 3291 3299 3292 3300 // Check for duplicates. 3293 $requests_query = new WP_Query( array( 3294 'post_type' => 'user_request', 3295 'post_name__in' => array( $action_name ), // Action name stored in post_name column. 3296 'title' => $email_address, // Email address stored in post_title column. 3297 'post_status' => 'any', 3298 'fields' => 'ids', 3299 ) ); 3301 $requests_query = new WP_Query( 3302 array( 3303 'post_type' => 'user_request', 3304 'post_name__in' => array( $action_name ), // Action name stored in post_name column. 3305 'title' => $email_address, // Email address stored in post_title column. 3306 'post_status' => 'any', 3307 'fields' => 'ids', 3308 ) 3309 ); 3300 3310 3301 3311 if ( $requests_query->found_posts ) { … … 3303 3313 } 3304 3314 3305 $request_id = wp_insert_post( array( 3306 'post_author' => $user_id, 3307 'post_name' => $action_name, 3308 'post_title' => $email_address, 3309 'post_content' => wp_json_encode( $request_data ), 3310 'post_status' => 'request-pending', 3311 'post_type' => 'user_request', 3312 'post_date' => current_time( 'mysql', false ), 3313 'post_date_gmt' => current_time( 'mysql', true ), 3314 ), true ); 3315 $request_id = wp_insert_post( 3316 array( 3317 'post_author' => $user_id, 3318 'post_name' => $action_name, 3319 'post_title' => $email_address, 3320 'post_content' => wp_json_encode( $request_data ), 3321 'post_status' => 'request-pending', 3322 'post_type' => 'user_request', 3323 'post_date' => current_time( 'mysql', false ), 3324 'post_date_gmt' => current_time( 'mysql', true ), 3325 ), 3326 true 3327 ); 3315 3328 3316 3329 return $request_id; … … 3381 3394 'email' => $request->email, 3382 3395 'description' => wp_user_request_action_description( $request->action_name ), 3383 'confirm_url' => add_query_arg( array( 3384 'action' => 'confirmaction', 3385 'request_id' => $request_id, 3386 'confirm_key' => wp_generate_user_request_key( $request_id ), 3387 ), wp_login_url() ), 3396 'confirm_url' => add_query_arg( 3397 array( 3398 'action' => 'confirmaction', 3399 'request_id' => $request_id, 3400 'confirm_key' => wp_generate_user_request_key( $request_id ), 3401 ), 3402 wp_login_url() 3403 ), 3388 3404 'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), 3389 3405 'siteurl' => home_url(), … … 3497 3513 } 3498 3514 3499 wp_update_post( array( 3500 'ID' => $request_id, 3501 'post_status' => 'request-pending', 3502 'post_password' => $wp_hasher->HashPassword( $key ), 3503 'post_modified' => current_time( 'mysql', false ), 3504 'post_modified_gmt' => current_time( 'mysql', true ), 3505 ) ); 3515 wp_update_post( 3516 array( 3517 'ID' => $request_id, 3518 'post_status' => 'request-pending', 3519 'post_password' => $wp_hasher->HashPassword( $key ), 3520 'post_modified' => current_time( 'mysql', false ), 3521 'post_modified_gmt' => current_time( 'mysql', true ), 3522 ) 3523 ); 3506 3524 3507 3525 return $key;
Note: See TracChangeset
for help on using the changeset viewer.