summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-22 20:40:39 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-01-22 20:40:39 +0000
commitc7df78f3b6aee78403e8563b504e10770270fb24 (patch)
treef332e13234a7721cb64b0133fc97e7e3c666dfe7 /app
parenta4c10376ce64eb21bee1a2ed6ce5f4c92b343344 (diff)
downloadredmine-c7df78f3b6aee78403e8563b504e10770270fb24.tar.gz
redmine-c7df78f3b6aee78403e8563b504e10770270fb24.zip
Wrong redmine link after referencing an object from a different project (#12930).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11258 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/helpers/application_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index f923b7b6c..90c0072a9 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -658,10 +658,11 @@ module ApplicationHelper
# identifier:document:"Some document"
# identifier:version:1.0.0
# identifier:source:some/file
- def parse_redmine_links(text, project, obj, attr, only_path, options)
+ def parse_redmine_links(text, default_project, obj, attr, only_path, options)
text.gsub!(%r{([\s\(,\-\[\>]|^)(!)?(([a-z0-9\-_]+):)?(attachment|document|version|forum|news|message|project|commit|source|export)?(((#)|((([a-z0-9\-]+)\|)?(r)))((\d+)((#note)?-(\d+))?)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]][^A-Za-z0-9_/])|,|\s|\]|<|$)}) do |m|
leading, esc, project_prefix, project_identifier, prefix, repo_prefix, repo_identifier, sep, identifier, comment_suffix, comment_id = $1, $2, $3, $4, $5, $10, $11, $8 || $12 || $18, $14 || $19, $15, $17
link = nil
+ project = default_project
if project_identifier
project = Project.visible.find_by_identifier(project_identifier)
end