- Timestamp:
- 08/13/2018 04:31:31 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r43527 r43568 2197 2197 2198 2198 if ( ! $request || 'export_personal_data' !== $request->action_name ) { 2199 return new WP_Error( 'invalid ', __( 'Invalid request ID when sending personal data export email.' ) );2199 return new WP_Error( 'invalid_request', __( 'Invalid request ID when sending personal data export email.' ) ); 2200 2200 } 2201 2201 … … 2257 2257 2258 2258 if ( ! $mail_success ) { 2259 return new WP_Error( ' error', __( 'Unable to send personal data export email.' ) );2259 return new WP_Error( 'privacy_email_error', __( 'Unable to send personal data export email.' ) ); 2260 2260 } 2261 2261 -
trunk/src/wp-includes/user.php
r43477 r43568 3358 3358 * 3359 3359 * @param string $request_id ID of the request created via wp_create_user_request(). 3360 * @return WP_Error|bool Will return true/false based on the success of sending the email, or a WP_Error object.3360 * @return bool|WP_Error True on success, `WP_Error` on failure. 3361 3361 */ 3362 3362 function wp_send_user_request( $request_id ) { … … 3365 3365 3366 3366 if ( ! $request ) { 3367 return new WP_Error( 'user_request_error', __( 'Invalid request.' ) ); 3368 } 3367 return new WP_Error( 'invalid_request', __( 'Invalid user request.' ) ); 3368 } 3369 3370 // Localize message content for user; fallback to site default for visitors. 3371 if ( ! empty( $request->user_id ) ) { 3372 $locale = get_user_locale( $request->user_id ); 3373 } else { 3374 $locale = get_locale(); 3375 } 3376 3377 $switched_locale = switch_to_locale( $locale ); 3369 3378 3370 3379 $email_data = array( … … 3455 3464 $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data ); 3456 3465 3457 return wp_mail( $email_data['email'], $subject, $content ); 3466 $email_sent = wp_mail( $email_data['email'], $subject, $content ); 3467 3468 if ( $switched_locale ) { 3469 restore_previous_locale(); 3470 } 3471 3472 if ( ! $email_sent ) { 3473 return new WP_Error( 'privacy_email_error', __( 'Unable to send personal data export confirmation email.' ) ); 3474 } 3475 3476 return true; 3458 3477 } 3459 3478 … … 3505 3524 3506 3525 if ( ! $request ) { 3507 return new WP_Error( ' user_request_error', __( 'Invalid request.' ) );3526 return new WP_Error( 'invalid_request', __( 'Invalid request.' ) ); 3508 3527 } 3509 3528 … … 3592 3611 * @var int 3593 3612 */ 3594 3595 3613 public $user_id = 0; 3596 3614 -
trunk/tests/phpunit/data/languages/de_DE.po
r38930 r43568 1 # Translation of 4. 6.x in German2 # This file is distributed under the same license as the 4. 6.x package.1 # Translation of 4.9.x in German 2 # This file is distributed under the same license as the 4.9.x package. 3 3 msgid "" 4 4 msgstr "" 5 "PO-Revision-Date: 201 6-10-25 18:27+0200\n"5 "PO-Revision-Date: 2018-08-13 19:19+0300\n" 6 6 "MIME-Version: 1.0\n" 7 7 "Content-Type: text/plain; charset=UTF-8\n" 8 8 "Content-Transfer-Encoding: 8bit\n" 9 9 "Plural-Forms: nplurals=2; plural=n != 1;\n" 10 "X-Generator: Poedit 1.8.10\n"11 "Project-Id-Version: 4.6.x\n"10 "X-Generator: Poedit 2.1.1\n" 11 "Project-Id-Version: Development (4.9.x)\n" 12 12 "Language: de_DE\n" 13 "POT-Creation-Date: \n" 14 "Last-Translator: \n" 15 "Language-Team: \n" 13 16 14 17 #. translators: Translate this to the correct language tag for your locale, see … … 41 44 msgid "Update %s now" 42 45 msgstr "Jetzt %s aktualisieren" 46 47 #. translators: Privacy data request subject. 1: Site name, 2: Name of the action 48 #: wp-includes/user.php:3445 49 msgid "[%1$s] Confirm Action: %2$s" 50 msgstr "[%1$s] Aktion bestätigen: %2$s" -
trunk/tests/phpunit/data/languages/es_ES.po
r38930 r43568 1 # Translation of Development (4. 4.x) in Spanish (Spain)2 # This file is distributed under the same license as the Development (4. 4.x) package.1 # Translation of Development (4.9.x) in Spanish (Spain) 2 # This file is distributed under the same license as the Development (4.9.x) package. 3 3 msgid "" 4 4 msgstr "" 5 "PO-Revision-Date: 201 6-10-25 18:28+0200\n"5 "PO-Revision-Date: 2018-08-13 19:19+0300\n" 6 6 "MIME-Version: 1.0\n" 7 7 "Content-Type: text/plain; charset=UTF-8\n" 8 8 "Content-Transfer-Encoding: 8bit\n" 9 9 "Plural-Forms: nplurals=2; plural=n != 1;\n" 10 "X-Generator: Poedit 1.8.10\n"11 "Project-Id-Version: Development (4. 4.x)\n"10 "X-Generator: Poedit 2.1.1\n" 11 "Project-Id-Version: Development (4.9.x)\n" 12 12 "Language: es_ES\n" 13 "POT-Creation-Date: \n" 14 "Last-Translator: \n" 15 "Language-Team: \n" 13 16 14 17 #. translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. … … 37 40 msgid "(Currently set to: %s)" 38 41 msgstr "(Actualmente fijado en: %s)" 42 43 #. translators: Privacy data request subject. 1: Site name, 2: Name of the action 44 #: wp-includes/user.php:3445 45 msgid "[%1$s] Confirm Action: %2$s" 46 msgstr "[%1$s] Confirma la acción: %2$s" -
trunk/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php
r43291 r43568 40 40 * @since 4.9.6 41 41 */ 42 function setUp() {42 public function setUp() { 43 43 parent::setUp(); 44 44 reset_phpmailer_instance(); … … 50 50 * @since 4.9.6 51 51 */ 52 function tearDown() {52 public function tearDown() { 53 53 reset_phpmailer_instance(); 54 54 parent::tearDown(); … … 96 96 $email_sent = wp_privacy_send_personal_data_export_email( $request_id ); 97 97 $this->assertWPError( $email_sent ); 98 $this->assertSame( 'invalid ', $email_sent->get_error_code() );98 $this->assertSame( 'invalid_request', $email_sent->get_error_code() ); 99 99 100 100 $request_id = PHP_INT_MAX; 101 101 $email_sent = wp_privacy_send_personal_data_export_email( $request_id ); 102 102 $this->assertWPError( $email_sent ); 103 $this->assertSame( 'invalid ', $email_sent->get_error_code() );103 $this->assertSame( 'invalid_request', $email_sent->get_error_code() ); 104 104 } 105 105 … … 112 112 add_filter( 'wp_mail_from', '__return_empty_string' ); // Cause `wp_mail()` to return false. 113 113 $email_sent = wp_privacy_send_personal_data_export_email( self::$request_id ); 114 remove_filter( 'wp_mail_from', '__return_empty_string' );115 114 116 115 $this->assertWPError( $email_sent ); 117 $this->assertSame( ' error', $email_sent->get_error_code() );116 $this->assertSame( 'privacy_email_error', $email_sent->get_error_code() ); 118 117 } 119 118 … … 126 125 add_filter( 'wp_privacy_export_expiration', array( $this, 'modify_export_expiration' ) ); 127 126 wp_privacy_send_personal_data_export_email( self::$request_id ); 128 remove_filter( 'wp_privacy_export_expiration', array( $this, 'modify_export_expiration' ) );129 127 130 128 $mailer = tests_retrieve_phpmailer_instance(); … … 153 151 add_filter( 'wp_privacy_personal_data_email_content', array( $this, 'modify_email_content' ), 10, 2 ); 154 152 wp_privacy_send_personal_data_export_email( self::$request_id ); 155 remove_filter( 'wp_privacy_personal_data_email_content', array( $this, 'modify_email_content' ) );156 153 157 154 $mailer = tests_retrieve_phpmailer_instance();
Note: See TracChangeset
for help on using the changeset viewer.