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

WordPress Trac noreply at wordpress.org
Thu Dec 5 00:36:18 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:
-------------------------+------------------------------

Comment (by dd32):

 Replying to [comment:4 swissspidy]:
 > There was a suggestion on Slack to simply ensure that GlotPress won't
 export such strings with incorrect placeholders. I think that addresses
 the problem quite nicely.

 There's a warning in GlotPress for when there's a mismatch in
 placeholders, but every release cycle we find someone has seen the warning
 and discarded it :)

 Currently we don't "track" strings that are in a `printf()` style
 function, we just assume that anything that has "printf-like" placeholders
 is a printf string, which for the most part works, but there's the
 possibility of false-positives.

 This is likely just a suggestion that the translation system needs to be
 far more strict about that warning, and likely not allowing it to be
 discarded at all.

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


More information about the wp-trac mailing list