Project

General

Profile

Actions

Defect #12359

closed

Version date field regex validation accepts invalid date

Defect #12359: Version date field regex validation accepts invalid date

Added by Róbert Ágoston about 14 years ago. Updated about 14 years ago.

Status:
Closed
Priority:
Normal
Category:
Roadmap
Target version:
Resolution:
Fixed
Affected version:

Description

Version date field regexp validation accepts invalid dates like "2012-11-33". Stored value is nil and no validation errors.

I attached a proposed patch that fixes this bug.


Files

version_validate_effective_date.diff (1.63 KB) version_validate_effective_date.diff Proposed patch. Róbert Ágoston, 2012-11-14 17:23

Related issues 1 (0 open — 1 closed)

Related to Redmine - Defect #9394: Custom date field only validating on regex and not a valid dateClosedActions

Updated by Etienne Massip about 14 years ago Actions #1

  • Category set to Custom fields

Why not try User.current.time_zone.parse(effective_date_before_type_cast)?

Updated by Etienne Massip about 14 years ago Actions #2

  • Category changed from Custom fields to Roadmap

Updated by Róbert Ágoston about 14 years ago Actions #3

Etienne Massip wrote:

Why not try User.current.time_zone.parse(effective_date_before_type_cast)?

I just read that "Redmine only supports YYYY-MM-DD format for entering dates".
I read that at #10560#note-2
A similar bug was fixed in r7779 with the same method.

Updated by Jean-Philippe Lang about 14 years ago Actions #4

  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.1.3
  • Resolution set to Fixed

Fix committed in r10810 with slight changes, thanks.

Updated by Jean-Philippe Lang about 14 years ago Actions #5

  • Status changed from Resolved to Closed

Merged in 2.1-stable.

Actions

Also available in: PDF Atom