[wp-trac] [WordPress Trac] #47546: The language used for the `lang` attribute isn't validated before being used

WordPress Trac noreply at wordpress.org
Wed Feb 28 14:14:35 UTC 2024


#47546: The language used for the `lang` attribute isn't validated before being
used
---------------------------------------+------------------------------
 Reporter:  johnbillion                |       Owner:  (none)
     Type:  defect (bug)               |      Status:  new
 Priority:  normal                     |   Milestone:  Awaiting Review
Component:  I18N                       |     Version:
 Severity:  normal                     |  Resolution:
 Keywords:  needs-testing needs-patch  |     Focuses:
---------------------------------------+------------------------------
Changes (by swissspidy):

 * keywords:  has-patch needs-testing => needs-testing needs-patch


Comment:

 I wouldn't necessarily want to call `get_available_languages()` on the
 frontend. The function is cached now though in 6.5, which is good.

 However, IMO this should be handled when saving the user meta, like
 `edit_user()` does.

 That could be further improved by registering these options with
 `register_meta` / `register_setting` and a dedicated sanitization
 callback.

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


More information about the wp-trac mailing list