View Issue Details

IDProjectCategoryView StatusLast Update
0017246mantisbtcustom fieldspublic2015-04-28 03:39
ReportervboctorAssigned Tovboctor 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.2.17 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0017246: Date custom fields can't store dates pre-1970
Description

If a user is to use custom fields for "date of birth", they will always get invalid date. The reason is that the validation assumes only dates are valid when their value is greater than 0. Though strtotime() returns 0 for 1970-01-01, false for invalid values, and negative for values before 1970.

PHP versions before 5.1 used to return -1 for invalid values. But that is not longer the case.
http://us3.php.net/manual/en/function.strtotime.php

The fix is to drop the check that the value is positive and just check for false. (EDIT dregad: false, not negative)

Tagsmantishub

Activities

dregad

dregad

2014-04-24 08:01

developer   ~0040158

See my comment in pull request https://github.com/mantisbt/mantisbt/pull/168

Related Changesets

MantisBT: master 085986c7

2014-04-29 22:04:49

mantishub

Details Diff
Fixes 0017246: Date custom fields can't store dates pre-1970.
mod - core/custom_field_api.php Diff File

MantisBT: master 4d8aa439

2014-05-01 22:12:09

mantishub

Details Diff
Fixes 0017246: Date custom fields can't store dates pre-1970. - part 2
mod - core/custom_field_api.php Diff File

Issue History

Date Modified Username Field Change
2014-04-23 23:43 vboctor New Issue
2014-04-23 23:43 vboctor Status new => assigned
2014-04-23 23:43 vboctor Assigned To => vboctor
2014-04-24 08:01 dregad Note Added: 0040158
2014-04-24 08:02 dregad Description Updated View Revisions
2014-04-29 22:05 mantishub Changeset attached => MantisBT master 085986c7
2014-04-29 22:05 mantishub Assigned To vboctor => mantishub
2014-04-29 22:05 mantishub Status assigned => resolved
2014-04-29 22:05 mantishub Resolution open => fixed
2014-04-29 22:05 mantishub Fixed in Version => 1.3.0-beta.1
2014-04-30 04:00 atrol Assigned To mantishub => vboctor
2014-04-30 04:00 atrol Target Version => 1.3.0-beta.1
2014-05-01 22:12 mantishub Changeset attached => MantisBT master 4d8aa439
2014-12-08 00:34 vboctor Status resolved => closed
2015-04-28 03:39 vboctor Tag Attached: mantishub