Rails 3.0.9.rc3 regression: url_for fails with html safe unicode params #1663

iGEL opened this Issue Jun 12, 2011 · 0 comments


None yet

2 participants


The following code raises an exception in Rails v3.0.8, v3.0.9.rc3, 3-0-stable and v3.1.0.rc4, but not in v3.0.7. I'm using ruby 1.9.2-p180, don't know about other rubies.

link_to "Günter", search_person_path(:name => "Günter".html_safe) # Raises exception

link_to "Günter", search_person_path(:name => "Guenter".html_safe) # works fine
link_to "Günter", search_person_path(:name => "Günter") # works fine

The exception is

undefined method `each_byte' for nil:NilClass

activesupport (3.0.9.rc3) lib/active_support/whiny_nil.rb:48:in `method_missing'
/home/igel/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/uri/common.rb:222:in `block in escape'
activesupport (3.0.9.rc3) lib/active_support/core_ext/string/output_safety.rb:119:in `gsub'
activesupport (3.0.9.rc3) lib/active_support/core_ext/string/output_safety.rb:119:in `gsub'
/home/igel/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/uri/common.rb:219:in `escape'
rack-mount (0.6.14) lib/rack/mount/utils.rb:72:in `escape_uri'
@pixeltrix pixeltrix was assigned Jun 12, 2011
@pixeltrix pixeltrix closed this in a64b5dd Jun 12, 2011
@jmileham jmileham pushed a commit to jmileham/rails that referenced this issue Jun 16, 2011
@tenderlove tenderlove Merge branch '3-0-stable' into 3-0-9
* 3-0-stable:
  Add support for using an ARCONFIG environment variable to specify the location of the config.yml file for running the tests
  Define ActiveSupport#to_param as to_str - closes #1663
  Revert "Make sure that we don't perform in-place mutation on SafeBuffer string"
  Make sure that we don't perform in-place mutation on SafeBuffer string
  Update CHANGELOG to mention the json_escape change
  Ensure number helpers can handle HTML safe strings - closes #1597.
  ensuring that json_escape returns html safe strings when passed an html safe string
  Fix issue #1598 by adding a dependency to the RDoc gem.
  Make sure `escape_javascript` return `SafeBuffer` if the incoming argument is already html_safe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment