Fix strip_links so that it doesn't hang on multi-line acronym tags

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4446 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jamis Buck 2006-06-08 17:19:58 +00:00
parent 38efc32529
commit 486af0254a
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
*SVN*
* Fix strip_links so that it doesn't hang on multiline <acronym> tags [Jamis Buck]
* Remove problematic control chars in rescue template. #5316 [Stefan Kaes]
* Make sure passed routing options are not mutated by routing code. #5314 [Blair Zajac]

View File

@ -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.*>(.*)<\/a>/m, '\1')
text.gsub(/<a\b.*?>(.*?)<\/a>/m, '\1')
end
# Try to require the html-scanner library