Ticket #46302: 48431.diff
File 48431.diff, 9.5 KB (added by , 5 years ago) |
---|
-
src/wp-admin/includes/ajax-actions.php
4710 4710 4711 4711 check_ajax_referer( 'wp-privacy-export-personal-data-' . $request_id, 'security' ); 4712 4712 4713 // Get the request data.4714 $request = wp_get_user_request _data( $request_id );4713 // Get the request. 4714 $request = wp_get_user_request( $request_id ); 4715 4715 4716 4716 if ( ! $request || 'export_personal_data' !== $request->action_name ) { 4717 4717 wp_send_json_error( __( 'Invalid request type.' ) ); … … 4901 4901 4902 4902 check_ajax_referer( 'wp-privacy-erase-personal-data-' . $request_id, 'security' ); 4903 4903 4904 // Get the request data.4905 $request = wp_get_user_request _data( $request_id );4904 // Get the request. 4905 $request = wp_get_user_request( $request_id ); 4906 4906 4907 4907 if ( ! $request || 'remove_personal_data' !== $request->action_name ) { 4908 4908 wp_send_json_error( __( 'Invalid request type.' ) ); -
src/wp-admin/includes/class-wp-privacy-requests-table.php
302 302 $requests = $requests_query->posts; 303 303 304 304 foreach ( $requests as $request ) { 305 $this->items[] = wp_get_user_request _data( $request->ID );305 $this->items[] = wp_get_user_request( $request->ID ); 306 306 } 307 307 308 308 $this->items = array_filter( $this->items ); -
src/wp-admin/includes/deprecated.php
1563 1563 function _wp_privacy_requests_screen_options() { 1564 1564 _deprecated_function( __FUNCTION__, '5.3.0' ); 1565 1565 } 1566 1567 /** 1568 * Return the user request object for the specified request ID. 1569 * 1570 * @since 4.9.6 1571 * @deprecated 5.4.0 Use wp_get_user_request() 1572 * @see wp_get_user_request() 1573 * 1574 * @param int $request_id The ID of the user request. 1575 * @return WP_User_Request|false 1576 */ 1577 function wp_get_user_request_data( $request_id ) { 1578 _deprecated_function( __FUNCTION__, '5.4.0', 'wp_get_user_request()' ); 1579 return wp_get_user_request( $request_id ); 1580 } 1581 No newline at end of file -
src/wp-admin/includes/privacy-tools.php
44 44 * @return int|WP_Error $result Request ID on success or WP_Error. 45 45 */ 46 46 function _wp_privacy_completed_request( $request_id ) { 47 // Get the request. 47 48 $request_id = absint( $request_id ); 48 $request = wp_get_user_request _data( $request_id );49 $request = wp_get_user_request( $request_id ); 49 50 50 51 if ( ! $request ) { 51 52 return new WP_Error( 'privacy_request_error', __( 'Invalid request.' ) ); … … 288 289 wp_send_json_error( __( 'Unable to generate export file. ZipArchive not available.' ) ); 289 290 } 290 291 291 // Get the request data.292 $request = wp_get_user_request _data( $request_id );292 // Get the request. 293 $request = wp_get_user_request( $request_id ); 293 294 294 295 if ( ! $request || 'export_personal_data' !== $request->action_name ) { 295 296 wp_send_json_error( __( 'Invalid request ID when generating export file.' ) ); … … 499 500 * @return true|WP_Error True on success or `WP_Error` on failure. 500 501 */ 501 502 function wp_privacy_send_personal_data_export_email( $request_id ) { 502 // Get the request data.503 $request = wp_get_user_request _data( $request_id );503 // Get the request. 504 $request = wp_get_user_request( $request_id ); 504 505 505 506 if ( ! $request || 'export_personal_data' !== $request->action_name ) { 506 507 return new WP_Error( 'invalid_request', __( 'Invalid request ID when sending personal data export email.' ) ); … … 669 670 return $response; 670 671 } 671 672 672 // Get the request data.673 $request = wp_get_user_request _data( $request_id );673 // Get the request. 674 $request = wp_get_user_request( $request_id ); 674 675 675 676 if ( ! $request || 'export_personal_data' !== $request->action_name ) { 676 677 wp_send_json_error( __( 'Invalid request ID when merging exporter data.' ) ); … … 813 814 return $response; 814 815 } 815 816 816 $request = wp_get_user_request_data( $request_id ); 817 // Get the request. 818 $request = wp_get_user_request( $request_id ); 817 819 818 820 if ( ! $request || 'remove_personal_data' !== $request->action_name ) { 819 821 wp_send_json_error( __( 'Invalid request ID when processing eraser data.' ) ); -
src/wp-includes/user.php
3027 3027 * @param int $request_id ID of the request. 3028 3028 */ 3029 3029 function _wp_privacy_account_request_confirmed( $request_id ) { 3030 $request = wp_get_user_request _data( $request_id );3030 $request = wp_get_user_request( $request_id ); 3031 3031 3032 3032 if ( ! $request ) { 3033 3033 return; … … 3057 3057 * @param int $request_id The ID of the request. 3058 3058 */ 3059 3059 function _wp_privacy_send_request_confirmation_notification( $request_id ) { 3060 $request = wp_get_user_request _data( $request_id );3060 $request = wp_get_user_request( $request_id ); 3061 3061 3062 3062 if ( ! is_a( $request, 'WP_User_Request' ) || 'request-confirmed' !== $request->status ) { 3063 3063 return; … … 3196 3196 * @param int $request_id The privacy request post ID associated with this request. 3197 3197 */ 3198 3198 function _wp_privacy_send_erasure_fulfillment_notification( $request_id ) { 3199 $request = wp_get_user_request _data( $request_id );3199 $request = wp_get_user_request( $request_id ); 3200 3200 3201 3201 if ( ! is_a( $request, 'WP_User_Request' ) || 'request-completed' !== $request->status ) { 3202 3202 return; … … 3346 3346 * @return string $message The confirmation message. 3347 3347 */ 3348 3348 function _wp_privacy_account_request_confirmed_message( $request_id ) { 3349 $request = wp_get_user_request _data( $request_id );3349 $request = wp_get_user_request( $request_id ); 3350 3350 3351 3351 $message = '<p class="success">' . __( 'Action has been confirmed.' ) . '</p>'; 3352 3352 $message .= '<p>' . __( 'The site administrator has been notified and will fulfill your request as soon as possible.' ) . '</p>'; … … 3482 3482 */ 3483 3483 function wp_send_user_request( $request_id ) { 3484 3484 $request_id = absint( $request_id ); 3485 $request = wp_get_user_request _data( $request_id );3485 $request = wp_get_user_request( $request_id ); 3486 3486 3487 3487 if ( ! $request ) { 3488 3488 return new WP_Error( 'invalid_request', __( 'Invalid user request.' ) ); … … 3644 3644 global $wp_hasher; 3645 3645 3646 3646 $request_id = absint( $request_id ); 3647 $request = wp_get_user_request _data( $request_id );3647 $request = wp_get_user_request( $request_id ); 3648 3648 3649 3649 if ( ! $request ) { 3650 3650 return new WP_Error( 'invalid_request', __( 'Invalid request.' ) ); … … 3696 3696 } 3697 3697 3698 3698 /** 3699 * Return data about a user request.3699 * Return the user request object for the specified request ID. 3700 3700 * 3701 3701 * @since 4.9.6 3702 3702 * 3703 * @param int $request_id Request ID to get data about.3703 * @param int $request_id The ID of the user request. 3704 3704 * @return WP_User_Request|false 3705 3705 */ 3706 function wp_get_user_request _data( $request_id ) {3706 function wp_get_user_request( $request_id ) { 3707 3707 $request_id = absint( $request_id ); 3708 3708 $post = get_post( $request_id ); 3709 3709 -
tests/phpunit/tests/privacy/wpPrivacyGeneratePersonalDataExportFile.php
258 258 $this->assertTrue( file_exists( $report_dir . 'index.html' ) ); 259 259 260 260 $report_contents = file_get_contents( $report_dir . 'index.html' ); 261 $request = wp_get_user_request _data( self::$export_request_id );261 $request = wp_get_user_request( self::$export_request_id ); 262 262 263 263 $this->assertContains( '<h1>Personal Data Export</h1>', $report_contents ); 264 264 $this->assertContains( '<h2>About</h2>', $report_contents ); … … 285 285 $zip->extractTo( $report_dir ); 286 286 $zip->close(); 287 287 288 $request = wp_get_user_request _data( self::$export_request_id );288 $request = wp_get_user_request( self::$export_request_id ); 289 289 290 290 $this->assertTrue( file_exists( $report_dir . 'export.json' ) ); 291 291 -
tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php
152 152 } 153 153 154 154 /** 155 * Filter callback that modifies the recipient of the datarequest confirmation notification.155 * Filter callback that modifies the recipient of the user request confirmation notification. 156 156 * 157 157 * @since 4.9.8 158 158 * 159 159 * @param string $admin_email The email address of the notification recipient. 160 * @param WP_User_Request $request _dataThe request that is initiating the notification.160 * @param WP_User_Request $request The request that is initiating the notification. 161 161 * @return string Admin email address. 162 162 */ 163 public function modify_email_address( $admin_email, $request _data) {164 $admin_email = $request _data->email;163 public function modify_email_address( $admin_email, $request ) { 164 $admin_email = $request->email; 165 165 return $admin_email; 166 166 } 167 167