Changeset 43705
- Timestamp:
- 10/11/2018 04:03:23 AM (6 years ago)
- Location:
- branches/4.9
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-admin/includes/file.php
r43614 r43705 2060 2060 2061 2061 if ( ! $request || 'export_personal_data' !== $request->action_name ) { 2062 return new WP_Error( 'invalid _request', __( 'Invalid request ID when sending personal data export email.' ) );2062 return new WP_Error( 'invalid', __( 'Invalid request ID when sending personal data export email.' ) ); 2063 2063 } 2064 2064 … … 2120 2120 2121 2121 if ( ! $mail_success ) { 2122 return new WP_Error( ' privacy_email_error', __( 'Unable to send personal data export email.' ) );2122 return new WP_Error( 'error', __( 'Unable to send personal data export email.' ) ); 2123 2123 } 2124 2124 -
branches/4.9/src/wp-includes/user.php
r43624 r43705 3280 3280 * 3281 3281 * @param string $request_id ID of the request created via wp_create_user_request(). 3282 * @return bool|WP_Error True on success, `WP_Error` on failure.3282 * @return WP_Error|bool Will return true/false based on the success of sending the email, or a WP_Error object. 3283 3283 */ 3284 3284 function wp_send_user_request( $request_id ) { … … 3287 3287 3288 3288 if ( ! $request ) { 3289 return new WP_Error( 'invalid_request', __( 'Invalid user request.' ) ); 3290 } 3291 3292 // Localize message content for user; fallback to site default for visitors. 3293 if ( ! empty( $request->user_id ) ) { 3294 $locale = get_user_locale( $request->user_id ); 3295 } else { 3296 $locale = get_locale(); 3297 } 3298 3299 $switched_locale = switch_to_locale( $locale ); 3289 return new WP_Error( 'user_request_error', __( 'Invalid request.' ) ); 3290 } 3300 3291 3301 3292 $email_data = array( … … 3386 3377 $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data ); 3387 3378 3388 $email_sent = wp_mail( $email_data['email'], $subject, $content ); 3389 3390 if ( $switched_locale ) { 3391 restore_previous_locale(); 3392 } 3393 3394 if ( ! $email_sent ) { 3395 return new WP_Error( 'privacy_email_error', __( 'Unable to send personal data export confirmation email.' ) ); 3396 } 3397 3398 return true; 3379 return wp_mail( $email_data['email'], $subject, $content ); 3399 3380 } 3400 3381 … … 3446 3427 3447 3428 if ( ! $request ) { 3448 return new WP_Error( ' invalid_request', __( 'Invalid request.' ) );3429 return new WP_Error( 'user_request_error', __( 'Invalid request.' ) ); 3449 3430 } 3450 3431 … … 3533 3514 * @var int 3534 3515 */ 3516 3535 3517 public $user_id = 0; 3536 3518 -
branches/4.9/tests/phpunit/data/languages/de_DE.po
r43614 r43705 1 # Translation of 4. 9.x in German2 # This file is distributed under the same license as the 4. 9.x package.1 # Translation of 4.6.x in German 2 # This file is distributed under the same license as the 4.6.x package. 3 3 msgid "" 4 4 msgstr "" 5 "PO-Revision-Date: 201 8-08-13 19:19+0300\n"5 "PO-Revision-Date: 2016-10-25 18:27+0200\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 2.1.1\n"11 "Project-Id-Version: Development (4.9.x)\n"10 "X-Generator: Poedit 1.8.10\n" 11 "Project-Id-Version: 4.6.x\n" 12 12 "Language: de_DE\n" 13 "POT-Creation-Date: \n"14 "Last-Translator: \n"15 "Language-Team: \n"16 13 17 14 #. translators: Translate this to the correct language tag for your locale, see … … 44 41 msgid "Update %s now" 45 42 msgstr "Jetzt %s aktualisieren" 46 47 #. translators: Privacy data request subject. 1: Site name, 2: Name of the action48 #: wp-includes/user.php:344549 msgid "[%1$s] Confirm Action: %2$s"50 msgstr "[%1$s] Aktion bestätigen: %2$s" -
branches/4.9/tests/phpunit/data/languages/es_ES.po
r43614 r43705 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.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. 3 3 msgid "" 4 4 msgstr "" 5 "PO-Revision-Date: 201 8-08-13 19:19+0300\n"5 "PO-Revision-Date: 2016-10-25 18:28+0200\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 2.1.1\n"11 "Project-Id-Version: Development (4. 9.x)\n"10 "X-Generator: Poedit 1.8.10\n" 11 "Project-Id-Version: Development (4.4.x)\n" 12 12 "Language: es_ES\n" 13 "POT-Creation-Date: \n"14 "Last-Translator: \n"15 "Language-Team: \n"16 13 17 14 #. translators: 'rtl' or 'ltr'. This sets the text direction for WordPress. … … 40 37 msgid "(Currently set to: %s)" 41 38 msgstr "(Actualmente fijado en: %s)" 42 43 #. translators: Privacy data request subject. 1: Site name, 2: Name of the action44 #: wp-includes/user.php:344545 msgid "[%1$s] Confirm Action: %2$s"46 msgstr "[%1$s] Confirma la acción: %2$s" -
branches/4.9/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php
r43614 r43705 40 40 * @since 4.9.6 41 41 */ 42 publicfunction setUp() {42 function setUp() { 43 43 parent::setUp(); 44 44 reset_phpmailer_instance(); … … 50 50 * @since 4.9.6 51 51 */ 52 publicfunction tearDown() {52 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 _request', $email_sent->get_error_code() );98 $this->assertSame( 'invalid', $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 _request', $email_sent->get_error_code() );103 $this->assertSame( 'invalid', $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' ); 114 115 115 116 $this->assertWPError( $email_sent ); 116 $this->assertSame( ' privacy_email_error', $email_sent->get_error_code() );117 $this->assertSame( 'error', $email_sent->get_error_code() ); 117 118 } 118 119 … … 125 126 add_filter( 'wp_privacy_export_expiration', array( $this, 'modify_export_expiration' ) ); 126 127 wp_privacy_send_personal_data_export_email( self::$request_id ); 128 remove_filter( 'wp_privacy_export_expiration', array( $this, 'modify_export_expiration' ) ); 127 129 128 130 $mailer = tests_retrieve_phpmailer_instance(); … … 151 153 add_filter( 'wp_privacy_personal_data_email_content', array( $this, 'modify_email_content' ), 10, 2 ); 152 154 wp_privacy_send_personal_data_export_email( self::$request_id ); 155 remove_filter( 'wp_privacy_personal_data_email_content', array( $this, 'modify_email_content' ) ); 153 156 154 157 $mailer = tests_retrieve_phpmailer_instance();
Note: See TracChangeset
for help on using the changeset viewer.