#3896 closed defect (bug) (fixed)
Wrong indices in match array in parse_w3cdtf
Reported by: | mortenf | Owned by: | |
---|---|---|---|
Milestone: | 2.1.3 | Priority: | normal |
Severity: | critical | Version: | 2.1.1 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
In rss.php, in the function parse_w3cdtf, the date/time string to parse is matched against a regular expression, which captures parts using parantheses. The resulting array, $match, is then indexed to obtain each part, but the indices used are wrong in two cases.
Running on some versions of PHP, this leads to a warning when calling the function gmmktime:
Warning: gmmktime() expects parameter 3 to be long, string given in ...
The warning also makes the function return 0, leading to incorrect results.
Attachments (2)
Change History (7)
#3
@
18 years ago
I believe this patch is good.
I just did a little test program to parse a date string (which I will attach directly), and found that array item 7 has the seconds, and number 11 has the "Z" if present. The current rss.php (as of SVN revision [4718] of rss.php) definitely has the indices wrong (6 and 10 respectively), and the patch fixes it.
So I recommend installing this patch.
This issue is also present in the 2.0.x branch.