#22260 closed defect (bug) (fixed)
Incorrect sprintf replacement specifiers
| Reported by: | westi | Owned by: | westi |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | I18N | Version: | 3.4.2 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
14 years ago
- Resolution → fixed
- Status accepted → closed
That fixes all the cases I could find.
#7
follow-up:
↓ 8
@
14 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
@
14 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In [22270]: