aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-26 16:26:00 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-26 16:26:00 +0000
commitc554a9cabaa3c8bbed5a0dccb381fdc6d516972d (patch)
tree4a7d6df8f3631a30c725c5afd8c383269fff0ff0
parent82558186a34f6b852e9e52b78d411720476894ad (diff)
downloadrails-c554a9cabaa3c8bbed5a0dccb381fdc6d516972d.tar.gz
rails-c554a9cabaa3c8bbed5a0dccb381fdc6d516972d.tar.bz2
rails-c554a9cabaa3c8bbed5a0dccb381fdc6d516972d.zip
strip_links is case-insensitive. Closes #6285.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5191 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb2
-rw-r--r--actionpack/test/template/text_helper_test.rb1
3 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index bd52be4968..a66c43b850 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* strip_links is case-insensitive. #6285 [tagoh, Bob Silva]
+
* Clear the cache of possible controllers whenever Routes are reloaded. [Nicholas Seckar]
* Filters overhaul including meantime filter support using around filters + blocks. #5949 [Martin Emde, Roman Le Negrate, Stefan Kaes, Jeremy Kemper]
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index 9d8921bf86..27e093a1c3 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -152,7 +152,7 @@ module ActionView
# Turns all links into words, like "<a href="something">else</a>" to "else".
def strip_links(text)
- text.gsub(/<a\b.*?>(.*?)<\/a>/m, '\1')
+ text.gsub(/<a\b.*?>(.*?)<\/a>/mi, '\1')
end
# Try to require the html-scanner library
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index 850175109a..a3962095ae 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -51,6 +51,7 @@ class TextHelperTest < Test::Unit::TestCase
def test_strip_links
assert_equal "on my mind", strip_links("<a href='almost'>on my mind</a>")
+ assert_equal "on my mind", strip_links("<A href='almost'>on my mind</A>")
end
def test_highlighter