[wp-trac] [WordPress Trac] #44758: The REST API is not respecting the user's locale properly.

WordPress Trac noreply at wordpress.org
Sun Oct 21 15:06:56 UTC 2018


#44758: The REST API is not respecting the user's locale properly.
---------------------------------+-----------------------
 Reporter:  youknowriad          |       Owner:  pento
     Type:  enhancement          |      Status:  reopened
 Priority:  normal               |   Milestone:  5.0
Component:  REST API             |     Version:
 Severity:  normal               |  Resolution:
 Keywords:  has-patch fixed-5.0  |     Focuses:  rest-api
---------------------------------+-----------------------
Changes (by danielbachhuber):

 * keywords:  has-patch => has-patch fixed-5.0
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Replying to [comment:37 swissspidy]:
 > Not sure if the `wp_lang` part needs some additional sanitization by
 checking if the locale is part of `get_available_languages()` (or equals
 `en_US`)

 To close the loop on this, `wp-login.php` doesn't currently validate
 `$_GET['wp_lang']` against a whitelist, so I don't think it's necessary to
 in this case. `WP_Locale_Switcher->switch_to_locale()` is a no-op if
 `$locale` isn't available in `$this->available_languages`.

 Reopening for merge to trunk.

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


More information about the wp-trac mailing list