#2564 closed defect (bug) (fixed)
mysql2date() preg_replace() misinterpretation
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0.1 |
Component: | General | Keywords: | functions.php, mysql2date(), preg_replace(), backreference |
Focuses: | Cc: |
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)
#2
@
18 years ago
- Resolution set to duplicate
- Status changed from assigned to closed
Duplicate of #2521.
#3
@
18 years ago
- Resolution duplicate deleted
- Status changed from closed to 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
@
18 years ago
- Milestone changed from 2.1 to 2.0.3
- Resolution fixed deleted
- Status changed from closed to reopened
Reopen for inclusion in 2.0.3.
#9
@
18 years ago
- Resolution fixed deleted
- Status changed from closed to 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".
Note: See
TracTickets for help on using
tickets.
+1 This suggestion follows the guidelines set out at http://php.net/preg_replace for backreferences that may be followed by literal numbers.