diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-03 16:47:05 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2006-09-03 16:47:05 +0000 |
commit | 6d17ece9f2558fe6d64a97d0b99493e4de2d32eb (patch) | |
tree | 65cdc242bf914650329032553d056090615a5d5c /actionpack/lib | |
parent | db9be587196b2fdebacaecf54efe70940b006989 (diff) | |
download | rails-6d17ece9f2558fe6d64a97d0b99493e4de2d32eb.tar.gz rails-6d17ece9f2558fe6d64a97d0b99493e4de2d32eb.tar.bz2 rails-6d17ece9f2558fe6d64a97d0b99493e4de2d32eb.zip |
strip_tags returns nil for a blank arg such as nil or "". Closes #2229.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4916 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 8b724127a2..36ed899cf0 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -213,7 +213,8 @@ module ActionView # tokenizer and so it's HTML parsing ability is limited by that of html-scanner. # # Returns the tag free text. - def strip_tags(html) + def strip_tags(html) + return nil if html.blank? if html.index("<") text = "" tokenizer = HTML::Tokenizer.new(html) |