[Tickets #14130] Re: monthdayyear form element not saved in DB
noreply at bugs.horde.org
noreply at bugs.horde.org
Mon Oct 12 11:20:12 UTC 2015
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: https://bugs.horde.org/ticket/14130
------------------------------------------------------------------------------
Ticket | 14130
Updated By | Michael Rubinsky <mrubinsk at horde.org>
Summary | monthdayyear form element not saved in DB
Queue | Horde Framework Packages
Type | Bug
State | Feedback
Priority | 1. Low
Milestone |
Patch | 1
Owners |
------------------------------------------------------------------------------
Michael Rubinsky <mrubinsk at horde.org> (2015-10-12 11:20) wrote:
> The code in question should protect itself against not meaningful or
> erroneous parameters. It seems legitimate to not accept null as a
> format string as the null format never makes sense. The sames´goes
> for formats like an empty array, 0 and false.
I agree, but if you are protecting against an "empty" value, you
should explicitly check for this using empty(). This makes the code's
intent much cleaner. Setting the equality check as you did can hide
other issues (such as in this case where some code is passing a value
that is seemingly incorrect) or make them harder to track down.
More information about the bugs
mailing list