[wp-trac] [WordPress Trac] #44084: Privacy: The personal data export file should be generated in the user's locale

WordPress Trac noreply at wordpress.org
Fri Aug 17 21:03:42 UTC 2018


#44084: Privacy: The personal data export file should be generated in the user's
locale
-------------------------------------------------+-------------------------
 Reporter:  coreymckrill                         |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  4.9.9
Component:  Privacy                              |     Version:  4.9.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-unit-  |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by desrosj):

 [attachment:"44084.diff"] is a different approach than
 [attachment:"file.diff"].

 It utilizes the user ID stored in the `WP_User_Request` objectto prevent
 an unnecessary database query in `get_user_by()`. It also switches to the
 site's default locale if the current user is using a different locale, and
 switches back after the file is done generating.

 There are a few strings not included in the actual file that are still not
 translated:
 - the stripped email, which has `@` replaced with `-at-`.
 - the file basename, which is `wp-personal-data-file-$stripped_email`.

 These two strings should probably be translated as well. But proper
 sanitization will need to be added for filenames with non-English
 characters.

 Another situation to consider. An administrator can click a link to
 download the data export file in the admin. When that is clicked, a fresh
 file is generated. With [attachment:"44084.diff"], the file will always be
 in the user's selected locale. Should the file ever be generated in the
 administrator's locale instead?

 Tests for this change should be added to the test class being worked on in
 #44233. I can add those once that is committed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44084#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list