diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-03-24 20:26:22 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-03-24 20:26:22 +0000 |
commit | 8cdcf308bef6a2ad9ee4fcf60ae9d716f6c562e8 (patch) | |
tree | 0eb31156bc692f172ed19595b02e73c1e17ebb7b /test | |
parent | 84dfff5957d4486258a1e4a30b9a72933278c1df (diff) | |
download | redmine-8cdcf308bef6a2ad9ee4fcf60ae9d716f6c562e8.tar.gz redmine-8cdcf308bef6a2ad9ee4fcf60ae9d716f6c562e8.zip |
Escape href attribute in auto links (#5179).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3612 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 656d05f8c..180093bed 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -60,12 +60,14 @@ class ApplicationHelperTest < HelperTestCase 'sftp://foo.bar' => '<a class="external" href="sftp://foo.bar">sftp://foo.bar</a>', # two exclamation marks 'http://example.net/path!602815048C7B5C20!302.html' => '<a class="external" href="http://example.net/path!602815048C7B5C20!302.html">http://example.net/path!602815048C7B5C20!302.html</a>', + # escaping + 'http://foo"bar' => '<a class="external" href="http://foo"bar">http://foo"bar</a>', } to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } end def test_auto_mailto - assert_equal '<p><a href="mailto:test@foo.bar" class="email">test@foo.bar</a></p>', + assert_equal '<p><a class="email" href="mailto:test@foo.bar">test@foo.bar</a></p>', textilizable('test@foo.bar') end @@ -130,6 +132,8 @@ RAW "\"system administrator\":mailto:sysadmin@example.com?subject=redmine%20permissions" => "<a href=\"mailto:sysadmin@example.com?subject=redmine%20permissions\">system administrator</a>", # two exclamation marks '"a link":http://example.net/path!602815048C7B5C20!302.html' => '<a href="http://example.net/path!602815048C7B5C20!302.html" class="external">a link</a>', + # escaping + '"test":http://foo"bar' => '<a href="http://foo"bar" class="external">test</a>', } to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } end |