#22260 closed defect (bug) (fixed)
Incorrect sprintf replacement specifiers
Reported by: | westi | Owned by: | westi |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.4.2 |
Component: | I18N | Keywords: | |
Focuses: | Cc: |
Description
We have a number of places in core where we are incorrectly using %1s instead of %1$s while this doesn't break the functionality of the code it does have the potential to lead to incorrect translations if the i18n teams re-order the replacements buy don't know to insert the missing $.
This is because without the $ we are specifying the minimum with of the replacement rather than a numbered replacement.
From http://uk.php.net/sprintf:
An optional number, a width specifier that says how many characters (minimum) this conversion should result in.
We need to review the following and fix them as appropriate:
- wp-admin/includes/ms.php:409
- wp-admin/network/site-new.php:88
- wp-admin/users.php:232
- wp-admin/users.php:234
- wp-admin/users.php:333
- wp-admin/users.php:335
- wp-admin/users.php:337
- wp-includes/ms-functions.php:1018
- wp-includes/ms-functions.php:1053
Attachments (1)
Change History (11)
#6
@
12 years ago
- Resolution set to fixed
- Status changed from accepted to closed
That fixes all the cases I could find.
#7
follow-up:
↓ 8
@
12 years ago
If you want it, 22260.2.diff adds number specifiers to many sprintf's using several consecutive standalone specifiers like %s, %o, %d, etc.
#8
in reply to:
↑ 7
@
12 years ago
Replying to DrewAPicture:
If you want it, 22260.2.diff adds number specifiers to many sprintf's using several consecutive standalone specifiers like %s, %o, %d, etc.
I would love for us to do a sweep through everything and do this, but it should be on a new ticket and not for this release :)
Could you open a new ticket for this please.
In [22270]: