From: Jean-Philippe Lang Date: Sat, 2 Feb 2008 15:51:48 +0000 (+0000) Subject: Do not authorize project identifier with numbers only (would be interpreted as the... X-Git-Tag: 0.7.0-RC1~178 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0123dc36515d103d29fd9225bad22aae664a2c12;p=redmine.git Do not authorize project identifier with numbers only (would be interpreted as the project id in urls). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1108 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/project.rb b/app/models/project.rb index 42f2ddfd9..73a8d6404 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -217,6 +217,7 @@ protected def validate errors.add(parent_id, " must be a root project") if parent and parent.parent errors.add_to_base("A project with subprojects can't be a subproject") if parent and children.size > 0 + errors.add(:identifier, :activerecord_error_invalid) if !identifier.blank? && identifier.match(/^\d*$/) end private