]> source.dussan.org Git - redmine.git/commitdiff
Merged r11473 from trunk (#3676).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Mar 2013 09:14:22 +0000 (09:14 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 9 Mar 2013 09:14:22 +0000 (09:14 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11564 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting.rb
test/unit/helpers/application_helper_test.rb

index 312f6c48c5498e424c0f79f3973c829f39053320..2a3023a094c9d518899fd6304385d425c88143c1 100644 (file)
@@ -95,7 +95,7 @@ module Redmine
                         (?:www\.)                # www.*
                       )
                       (
-                        (\S+?)                   # url
+                        ([^<]\S*?)               # url
                         (\/)?                    # slash
                       )
                       ((?:&gt;)?|[^[:alnum:]_\=\/;\(\)]*?)               # post
index 7d4d9b0bb7ac02ec02f353cd239ce1e389a9a216..250f3fb5a30ae8eba2e228a34c93760c6cdb9c31 100644 (file)
@@ -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