From b9c72bf5901a7e8d570fea506cdb4180895c8d45 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 30 Oct 2012 07:53:14 +0000 Subject: [PATCH] Validate value for date filters. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10767 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/query.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/query.rb b/app/models/query.rb index efa161a62..b5c932cfa 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -183,7 +183,7 @@ class Query < ActiveRecord::Base case operator_for(field) when "=", ">=", "<=", "><" add_filter_error(field, :invalid) if values_for(field).detect {|v| v.present? && (!v.match(/^\d{4}-\d{2}-\d{2}$/) || (Date.parse(v) rescue nil).nil?) } - when ">t-", "t-", "t+", "