View Issue Details

IDProjectCategoryView StatusLast Update
0017246mantisbtcustom fieldspublic2015-04-28 03:39
Reportervboctor Assigned 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 18:04

mantishub


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

MantisBT: master 4d8aa439

2014-05-01 18:12

mantishub


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