#2564 closed defect (bug) (fixed)
mysql2date() preg_replace() misinterpretation
| Reported by: | tenpura | Owned by: | markjaquith |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 2.0.1 |
| Severity: | normal | Keywords: | functions.php, mysql2date(), preg_replace(), backreference |
| Cc: | Focuses: |
Description
preg_replace() in mysql2date() is using "
1" as backreference and if this is immediately followed by a literal number, misinterpretation occurs.
Suggested Solution:
use "\${1}" instead of "
1"
Change History (12)
#3
@
21 years ago
- Resolution duplicate
- Status closed → reopened
Yes, date_i18n() part of that has already been fixed but mysql2date() part remains the same using "
1".
This is the same type of problem as ticket #2521 but regarding different section and unsolved.
#7
@
20 years ago
- Milestone 2.1 → 2.0.3
- Resolution fixed
- Status closed → reopened
Reopen for inclusion in 2.0.3.
#9
@
20 years ago
- Resolution fixed
- Status closed → reopened
(PHP 4.2.2. MySQL 3.23.51)
On a vanilla install of 2.0.3, the date shows up as: "{1}June 7th, 2006".
Once I reverted this fix in my local install, the date correctly showed as "June 7th, 2006".
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
+1 This suggestion follows the guidelines set out at http://php.net/preg_replace for backreferences that may be followed by literal numbers.