Opened 16 years ago
Closed 16 years ago
#2983 closed defect (bug) (fixed)
sprintf content needs to be in single quotes
| Reported by: | boonebgorges | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.5 |
| Component: | Core | Version: | |
| Severity: | 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
@
16 years ago
- Resolution fixed
- Status closed → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [3614]) Replaces sprintf double quotes with single quotes to avoid substitution problems. Fixes #2983