[wp-trac] [WordPress Trac] #62643: Prevent errors from `printf()` and `sprintf()` calls

WordPress Trac noreply at wordpress.org
Wed Dec 4 14:20:29 UTC 2024


#62643: Prevent errors from `printf()` and `sprintf()` calls
-------------------------+------------------------------
 Reporter:  grapestain   |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  I18N         |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  2nd-opinion  |     Focuses:
-------------------------+------------------------------
Changes (by swissspidy):

 * keywords:   => 2nd-opinion


Comment:

 While this may be tempting, hiding errors is dangerous, especially when
 plugin developers start using these functions as well and then don't care
 about their code quality.

 The general rule is that WordPress trusts the translations, which is why
 they aren't escaped either. To mitigate such cases, GlotPress generally
 adds warnings if it encounters things like missing placeholders or
 unbalanced HTML tags. IMO this is the preferred route.

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


More information about the wp-trac mailing list