]> source.dussan.org Git - redmine.git/commitdiff
Validate value for date filters.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 30 Oct 2012 07:53:14 +0000 (07:53 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 30 Oct 2012 07:53:14 +0000 (07:53 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10767 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/query.rb

index efa161a6275d19b7c457aad39cf8d02b2b0c3727..b5c932cfadf3c3df51c6348d72879086ca5334f9 100644 (file)
@@ -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-"
+          when ">t-", "<t-", "t-", ">t+", "<t+", "t+"
             add_filter_error(field, :invalid) if values_for(field).detect {|v| v.present? && !v.match(/^\d+$/) }
           end
         end