summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-23 16:51:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-23 16:51:13 +0000
commit28c094f50e3c64774e04581a77cb7b1c3de231e0 (patch)
tree239e03709775323a79b24553655b18c8717c90da
parent0d5b03bab7338da4a5c456f21d18dd09308e0d8a (diff)
downloadredmine-28c094f50e3c64774e04581a77cb7b1c3de231e0.tar.gz
redmine-28c094f50e3c64774e04581a77cb7b1c3de231e0.zip
Turn ftp urls into links (#1514).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1577 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/wiki_formatting.rb1
-rw-r--r--test/unit/helpers/application_helper_test.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 6c8eebbbc..952f636d3 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -129,6 +129,7 @@ module Redmine
)
(
(?:https?://)| # protocol spec, or
+ (?:ftp://)|
(?:www\.) # www.*
)
(
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 9504a8c79..45eb2df90 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -36,6 +36,7 @@ class ApplicationHelperTest < HelperTestCase
'http://foo.bar/page?p=1&t=z&s=' => '<a class="external" href="http://foo.bar/page?p=1&#38;t=z&#38;s=">http://foo.bar/page?p=1&#38;t=z&#38;s=</a>',
'http://foo.bar/page#125' => '<a class="external" href="http://foo.bar/page#125">http://foo.bar/page#125</a>',
'http://foo@www.bar.com' => '<a class="external" href="http://foo@www.bar.com">http://foo@www.bar.com</a>',
+ 'ftp://foo.bar' => '<a class="external" href="ftp://foo.bar">ftp://foo.bar</a>',
}
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end