summaryrefslogtreecommitdiffstats
path: root/app/models/custom_field.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-11-19 11:13:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-11-19 11:13:41 +0000
commit7b3f2b51c0ea735a4723fae24eff9bfbca254d8a (patch)
tree9d3f5786993a64e0f106ba82f31a9a1d8d06e6bb /app/models/custom_field.rb
parente610fda877a44c7b194edddcbe6c71bb234401a1 (diff)
downloadredmine-7b3f2b51c0ea735a4723fae24eff9bfbca254d8a.tar.gz
redmine-7b3f2b51c0ea735a4723fae24eff9bfbca254d8a.zip
Add length validations for string fields (#24283).
Patch by Felix Schäfer. git-svn-id: http://svn.redmine.org/redmine/trunk@15989 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/custom_field.rb')
-rw-r--r--app/models/custom_field.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/custom_field.rb b/app/models/custom_field.rb
index 46d45813c..8936a6d66 100644
--- a/app/models/custom_field.rb
+++ b/app/models/custom_field.rb
@@ -32,6 +32,7 @@ class CustomField < ActiveRecord::Base
validates_presence_of :name, :field_format
validates_uniqueness_of :name, :scope => :type
validates_length_of :name, :maximum => 30
+ validates_length_of :regexp, maximum: 30
validates_inclusion_of :field_format, :in => Proc.new { Redmine::FieldFormat.available_formats }
validate :validate_custom_field
attr_protected :id