View Issue Details

IDProjectCategoryView StatusLast Update
0016133mantisbtcustom fieldspublic2017-10-28 19:08
Reporterpolzin Assigned Tovboctor  
Status closedResolutionfixed 
Product Version2.7.0 
Target Version2.8.0Fixed in Version2.8.0 
Summary0016133: Numeric field accepts floats and displays them as numeric

Interestingly, for php floats are numeric. As a consequence, there is no difference between custom fields of type "numeric" and "float". The mantis-docs say, "numeric" means "is an integer", but any numeric value may be accepted.

A correct test for integer-strings is described here:

For "floats" is_numeric() is sufficient, although it allows "4e1" and "0x123". Therefore, a better solution would be valuable here, too.

Workaround: Use a string with regexps. :-/

Additional Information

TagsNo tags attached.


Related Changesets

MantisBT: master bc402539

2017-10-14 14:20:59


Details Diff
Numeric fields shouldn’t accept floats

Fixes 0016133
Affected Issues
mod - core/custom_field_api.php Diff File