From 0123dc36515d103d29fd9225bad22aae664a2c12 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 2 Feb 2008 15:51:48 +0000 Subject: [PATCH] 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 --- app/models/project.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/project.rb b/app/models/project.rb index 42f2ddfd..73a8d640 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