From d991e46f122d084c9465073256e7750b24898d49 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 17 Jun 2008 19:27:03 +0000 Subject: Fixed: urls containing @ are parsed as email adress by the wiki formatter (#1456). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1559 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/wiki_formatting.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/redmine/wiki_formatting.rb') diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb index 88a858b04..6c8eebbbc 100644 --- a/lib/redmine/wiki_formatting.rb +++ b/lib/redmine/wiki_formatting.rb @@ -152,12 +152,16 @@ module Redmine end end end - + # Turns all email addresses into clickable links (code from Rails). def inline_auto_mailto(text) text.gsub!(/([\w\.!#\$%\-+.]+@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+)/) do - text = $1 - %{#{text}} + mail = $1 + if text.match(/]*>(.*)(#{Regexp.escape(mail)})(.*)<\/a>/) + mail + else + %{} + end end end end -- cgit v1.2.3