Ticket #171 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

Element_Date accepts invalid dates

Reported by: sfuchs Owned by: argh
Priority: normal Milestone: v0.9.0 stable
Component: patForms Version: 0.9.0a2
Severity: normal Keywords:
Cc:

Description

Element_Date accepts "31.2.2005" as input value and returns it as 2005-03-02 (i.e. it "corrects" the invalid date) without throwing an error.

Change History

comment:1 Changed 8 years ago by schst

  • Owner changed from argh@… to argh

Use the username instead of the mail address.

comment:2 Changed 8 years ago by argh

  • Status changed from new to assigned

Could you tell me in which cases this happens? The element validation works (validation error thrown) when you try to input the wrong date in the Date example file that is included in the patForms package.

comment:3 Changed 8 years ago by schst

Just try to enter:

2005-02-31

This date does not exist, by I get Validation successful as a result.

comment:4 Changed 8 years ago by sfuchs

When I enter

2005.02.31. 23:12:48

http://examples.php-tools.net/patForms/examples/ (Date Element example)

I get "Validation successful."

Same thing with

2005.02.32. 23:12:48

:)

This is due to the strtotime conversion that is done IIRC in Element_Date::getDate() (called by setValue()) or so ...

comment:5 Changed 8 years ago by sfuchs

Ooops ... badly synchronized w/ schst ;)

comment:6 Changed 8 years ago by argh

  • Status changed from assigned to closed
  • Resolution set to fixed

This is fixed in SVN, however the validation routine currently only works with dates within the range of a unix timestamp.

Note: See TracTickets for help on using tickets.