diff options
author | Scott Barron <scott@elitists.net> | 2005-12-30 18:45:04 +0000 |
---|---|---|
committer | Scott Barron <scott@elitists.net> | 2005-12-30 18:45:04 +0000 |
commit | 63c822afb22ea17cffd55a3d1c3472405e977be5 (patch) | |
tree | 6f33746a7db15b80d803b642a440b2b0e573e996 /actionpack/lib/action_view | |
parent | b5ba377b784c58db7b7fb878862a550ae57beb95 (diff) | |
download | rails-63c822afb22ea17cffd55a3d1c3472405e977be5.tar.gz rails-63c822afb22ea17cffd55a3d1c3472405e977be5.tar.bz2 rails-63c822afb22ea17cffd55a3d1c3472405e977be5.zip |
Make auto_link handle nil by returning quickly if blank?
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3359 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/text_helper.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb index 1b1ca386c2..856c997e9a 100644 --- a/actionpack/lib/action_view/helpers/text_helper.rb +++ b/actionpack/lib/action_view/helpers/text_helper.rb @@ -142,6 +142,7 @@ module ActionView # truncate(text, 15) # end def auto_link(text, link = :all, href_options = {}, &block) + return '' if text.blank? case link when :all then auto_link_urls(auto_link_email_addresses(text, &block), href_options, &block) when :email_addresses then auto_link_email_addresses(text, &block) |