This project is archived and is in readonly mode.
Rails escapes quotes at when they are at beginning and and of signle-line string
Reported by nkuba | May 11th, 2010 @ 01:28 PM
When there are quotes at the begining and at the end of a
textarea rails escapes them, and stores string without quotes. It's
not happen with multiline strings.
For example given to textarea declerated as <%= f.text_area
:name %>
the text: "Test Scenario"
and I will got:
Parameters: {"commit"=>"Submit",
"authenticity_token"=>"YtwwTBw3pyniVxBzHVU5j5ZZ/nouhUqqm1iU59J0W68=",
"test"=>{"name"=>"Test scenario"}}
text: "Test
Scenario"
Will produce paramterers with quotes stored
Parameters: {"commit"=>"Submit",
"authenticity_token"=>"YtwwTBw3pyniVxBzHVU5j5ZZ/nouhUqqm1iU59J0W68=",
"test"=>{"name"=>""Test \r\nScenario""}}
Comments and changes to this ticket
-
Ryan Bigg May 13th, 2010 @ 11:46 PM
- Tag changed from escaping, quotes, textarea to bugmash, escaping, quotes, textarea
- State changed from new to incomplete
Please provide a failing test case and patch for this issue.
-
Neeraj Singh May 14th, 2010 @ 05:09 PM
- Tag changed from bugmash, escaping, quotes, textarea to bugmash, escaping, quotes, rails3, textarea
This is not a rails issue.
Rails is exhibiting this behavior because rack is doing all the work of converting user input in params. Take a look at this test case in rack. http://github.com/rack/rack/blob/master/test/spec_rack_utils.rb#L35 . rack is coded to remove the double quotes which the author of ticket does not want.
If you add a new line character then double quotes is preserved. http://github.com/neerajdotname/rack/commit/1454a2171032e2260dc7199...
I have posted a question on the rack mailing list about this issue. When a resolution comes I will update this issue.
-
Ryan Bigg May 15th, 2010 @ 11:12 AM
- Tag changed from bugmash, escaping, quotes, rails3, textarea to escaping, quotes, rails3, textarea
-
Ryan Bigg May 15th, 2010 @ 11:40 AM
- State changed from incomplete to wontfix
Not a rails bug, but a Rack one.
-
andreas July 27th, 2010 @ 08:45 PM
Dupe: #4808
Rails still requires the broken rack version, this should be fixed ASAP
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>