String#to_param in sinatra conflicts with ActiveSupport
Reported by Scott Fleckenstein | July 30th, 2008 @ 11:31 PM | in 0.3.0 Sammy
Sinatra defines to_param to URI escape the string it is called upon. Unfortunately, ActiveSupport depends on to_param for string to be an identity function. This can be illustrated with the following script:
require 'rubygems'
require 'active_support'
puts({"name" => "Scott Fleckenstein"}.to_query) # => name=Scott+Fleckenstein
require 'sinatra'
puts({"name" => "Scott Fleckenstein"}.to_query) # => name=Scott%2520Fleckenstein
exit(0)
to_param appears to be not used at all.
Comments and changes to this ticket
-
Blake Mizerany July 31st, 2008 @ 11:45 AM
Great find. Can you please send a pull request based off my `next` branch?
-
Ryan Tomayko September 7th, 2008 @ 06:57 AM
I've fixed this on my master:
http://github.com/rtomayko/sinat...
I'm way too diverged from the next branch for this to be merged cleanly, though.
-
Ryan Tomayko September 7th, 2008 @ 06:18 PM
- → Tag changed from bug escape to bug escape fixed
- → State changed from new to resolved
- → Assigned user changed from Blake Mizerany to Ryan Tomayko
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
