Opened 14 years ago
Closed 14 years ago
#2983 closed defect (bug) (fixed)
sprintf content needs to be in single quotes
Reported by: | boonebgorges | Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | major |
Severity: | Version: | ||
Component: | Core | Keywords: | |
Cc: |
Description
When you use the swappable characters notation for sprintf (%1$s vs %s), the pattern needs to be enclosed in single quotes, not double quotes. Otherwise PHP will attempt to read the $s as a variable, resulting in a PHP warning (because $s has not been defined) and, more importantly, a failed replacement.
Change History (4)
#2
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
The \n only gets coverted to a newline if it is in double quotes. In single quotes they are taken as literals instead of a control sequence.
Note: See
TracTickets for help on using
tickets.
(In [3614]) Replaces sprintf double quotes with single quotes to avoid substitution problems. Fixes #2983