Date validator validates invalid Dates

Bug #514376 reported by muss
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
play framework
Status tracked in 1.0
1.0
Fix Released
Medium
Unassigned
1.1
Fix Committed
Medium
Nicolas Leroux

Bug Description

In Yabe sample, Date validator accepts dates like 2024-28-46 and converts it then to 2026-05-16.

Revision history for this message
Nicolas Leroux (nicolas-lunatech) wrote :

This is a duplicates from #458431 and #458450. However, this two bugs have been fixed for the 1.1 branch only.

Revision history for this message
Guillaume Bort (guillaume-bort) wrote :

It is the same bug, it is just a problem of SimpleDateFormat that accept 2024-28-46 as input value. We should use JodaTime for parsing that has not the same problem.

Revision history for this message
Guillaume Bort (guillaume-bort) wrote :

'It is not' the same bug...

Revision history for this message
Nicolas Leroux (nicolas-lunatech) wrote :

However, this two bugs have been fixed for the 1.1 branch only -> those two bugs

Revision history for this message
Marcos Silva Pereira (marcospereira) wrote :

You don't need to use JodaTime, just configure the SimpleDateFormat to not be lenient:

formatter.setLenient(false);

Anyway, I will really appreciate if JodaTime is supported out-of-the-box.

Revision history for this message
Marcos Silva Pereira (marcospereira) wrote :

This patch set date format to not be lenient.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.