summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-02 15:51:48 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-02 15:51:48 +0000
commit0123dc36515d103d29fd9225bad22aae664a2c12 (patch)
tree60e78c7c4a48d15465c4fb5a698014c1e6225bcc /app
parent12c0f5f66e21bbfdeed82f00eabe7b47ed99d85f (diff)
downloadredmine-0123dc36515d103d29fd9225bad22aae664a2c12.tar.gz
redmine-0123dc36515d103d29fd9225bad22aae664a2c12.zip
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
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb1
1 files changed, 1 insertions, 0 deletions
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