[wp-trac] [WordPress Trac] #63642: Passing stringy number to _n() can result in a plural when singular is intended

WordPress Trac noreply at wordpress.org
Fri Jul 18 12:57:30 UTC 2025


#63642: Passing stringy number to _n() can result in a plural when singular is
intended
--------------------------------------+-----------------------------
 Reporter:  dd32                      |       Owner:  SergeyBiryukov
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  6.9
Component:  I18N                      |     Version:  6.5
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60484" 60484]:
 {{{
 #!CommitTicketReference repository="" revision="60484"
 I18N: Correct strict comparison in `WP_Translations::translate_plural()`.

 This ensures that the `$count` value is compared as an integer to account
 for plugins or themes passing a numeric string instead.

 Follow-up to [57337].

 Props dd32, mukesh27, swissspidy, pmbaldha, SergeyBiryukov.
 Fixes #63642.
 }}}

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


More information about the wp-trac mailing list