[wp-trac] [WordPress Trac] #45235: REST API: Setting _locale can cause fatal errors
WordPress Trac
noreply at wordpress.org
Fri Dec 14 12:14:19 UTC 2018
#45235: REST API: Setting _locale can cause fatal errors
--------------------------+------------------------------
Reporter: pento | Owner: danielbachhuber
Type: defect (bug) | Status: closed
Priority: high | Milestone: 5.0
Component: I18N | Version: 5.0
Severity: major | Resolution: fixed
Keywords: | Focuses: rest-api
--------------------------+------------------------------
Comment (by atimmer):
In [changeset:"44181" 44181]:
{{{
#!CommitTicketReference repository="" revision="44181"
l10n: Avoid calling is_user_logged_in() in determine_locale().
is_user_logged_in() is a pluggable function, and loaded after plugins are
loaded. If a plugin calls __() too early, is_user_logged_in() is missing
and WordPress will fatal. get_user_locale() already handles this scenario
for us, so it's safe to rely on exclusively.
Props danielbachhuber.
Merges [43846] to trunk.
See #44758.
Fixes #45235.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45235#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list