summaryrefslogtreecommitdiffstats
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-14 14:35:57 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-14 14:35:57 +0000
commit4b6b568635739c938a1a889770fca4a390c4fe26 (patch)
treef2ca8e2ba9a0f6d33751f124d3847894efe7d462 /app/models/issue.rb
parent5aaf9c734cf976693a818407b3b07f1b3d0aee5a (diff)
downloadredmine-4b6b568635739c938a1a889770fca4a390c4fe26.tar.gz
redmine-4b6b568635739c938a1a889770fca4a390c4fe26.zip
Fixed that entering #nnn as parent task should validate (#11979).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10658 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 13a21e07a..0029fffb9 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -416,7 +416,8 @@ class Issue < ActiveRecord::Base
end
if attrs['parent_issue_id'].present?
- unless Issue.visible(user).exists?(attrs['parent_issue_id'].to_i)
+ s = attrs['parent_issue_id'].to_s
+ unless (m = s.match(%r{\A#?(\d+)\z})) && Issue.visible(user).exists?(m[1])
@invalid_parent_issue_id = attrs.delete('parent_issue_id')
end
end