summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-03-09 09:14:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-03-09 09:14:22 +0000
commit998a29cbaf24eb43163fff1c7338a19a2bb7691c (patch)
tree80574e8feedde8bc926dfbb29860eaa20e7a9526
parent511099e9cac4dbe13416e9cfb7a0c1797ee64a10 (diff)
downloadredmine-998a29cbaf24eb43163fff1c7338a19a2bb7691c.tar.gz
redmine-998a29cbaf24eb43163fff1c7338a19a2bb7691c.zip
Merged r11473 from trunk (#3676).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11564 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/redmine/wiki_formatting.rb2
-rw-r--r--test/unit/helpers/application_helper_test.rb5
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index 312f6c48c..2a3023a09 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -95,7 +95,7 @@ module Redmine
(?:www\.) # www.*
)
(
- (\S+?) # url
+ ([^<]\S*?) # url
(\/)? # slash
)
((?:&gt;)?|[^[:alnum:]_\=\/;\(\)]*?) # post
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 7d4d9b0bb..250f3fb5a 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -84,7 +84,10 @@ class ApplicationHelperTest < ActionView::TestCase
# escaping
'http://foo"bar' => '<a class="external" href="http://foo&quot;bar">http://foo&quot;bar</a>',
# wrap in angle brackets
- '<http://foo.bar>' => '&lt;<a class="external" href="http://foo.bar">http://foo.bar</a>&gt;'
+ '<http://foo.bar>' => '&lt;<a class="external" href="http://foo.bar">http://foo.bar</a>&gt;',
+ # invalid urls
+ 'http://' => 'http://',
+ 'www.' => 'www.',
}
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end