[wp-trac] [WordPress Trac] #44550: The confirmaction page should also be in the user language
WordPress Trac
noreply at wordpress.org
Wed Aug 22 18:41:56 UTC 2018
#44550: The confirmaction page should also be in the user language
-------------------------------------------------+-------------------------
Reporter: birgire | Owner: desrosj
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.9.9
Component: Privacy | Version: 4.9.6
Severity: normal | Resolution:
Keywords: has-screenshots needs-testing has- | Focuses:
patch | administration
-------------------------------------------------+-------------------------
Comment (by desrosj):
I did not realize that the `wp-login.php` screen actually set up the
current user if a user was logged in. I just did some testing, and this is
true. TIL.
The patch could be changed to something like the following:
{{{
if ( is_user_logged_in() ) {
$lang = get_user_locale();
} elseif ( ! empty( $_GET['wp_lang'] ) ) {
sanitize_text_field( $_GET['wp_lang'] );
}
}}}
This would also affect other `wp-login.php` pages, though (login form,
forgotten password, etc.).
An edge case I can think of with this is when user A does not log out
properly and user B visits the login screen. If user A uses a different
locale than the site default, user B may be unable to use the page. There
is #14949 which would redirect the user to the admin when they visit the
login screen and are already logged in. This ticket would eliminate that
edge case.
I am leaning towards a new ticket using the logged in user's locale on
`wp-login.php` so that each scenario where a logged in user can access
`wp-login.php` can be evaluated.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44550#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list