Posted by Dmitriy.trt on July 11, 2012 at 4:21pm
2 followers
| Project: | Date |
| Version: | 7.x-2.x-dev |
| Component: | Date API |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
When you pass field settings with at least one zero value to the DateObject::limitGranularity(), it doesn't filter out anything, because non-strict comparison returns match for any granularity string and integer zero.
Patch follows.
Comments
#1
Fix and a test.
#2
I have same problem.
It needs to be accept.
Accepet above patch or change code using in_array function to add parameter 'strict' to TRUE.
http://php.net/manual/en/function.in-array.php
default 'strict' parameter is FALSE and it searchs on array keys too.
So, limitGranularity functions always don't remove granularity part.
#3
#4
Merge test case with patch in #2.
#5
Change tab to spaces.