This project is archived and is in readonly mode.
Textarea input silently truncated in 2.3.8!
-
Steve Purcell
- Tag changed from 2.3.8 actionpack params to 2.3.8, actionpack, params
-
José Valim
Steve, can you reproduce it in Rails test suite? It makes much easier for us to investigate.
-
Steve Purcell
Okay, a patch providing a test case is attached, together with a dump of the original raw request (which came from Chrome on Mac, though the same problem is evident with Safari).
-
Steve Purcell
The problem, incidentally, seems related to the url-encoded quote marks in the string.
-
Neeraj Singh
previous version of rack used to remove quotes if there is no line break.
It was recently changed after much debate on rack mailing list. http://github.com/rack/rack/commit/dae12e088592ee69545b5f2f81b87f49...
-
Steve Purcell
Re: the Rack changes -- wow, I'm amazed there was any debate; it seems like removing parts of the submitted text would obviously be a bad idea.
But is this a Rack issue? Does the code covered by this patched test ask the Rack stack to parse the URL-encoded params? Or is this parsing Rails-specific? It would be odd to test Rack in a Rails test.
And if so, I have a question: submitting the sample text to the same test app running under Rails 2.3.5 on the same machine did not cause the problem. Does this mean the two Rails versions were picking up different Rack gems (I have 1.2.1, 1.1.0 and 1.0.1 installed)? And if the problem was an old Rack gem, why would the newer Rails version (2.3.8) show this problem?
-
Neeraj Singh
I did not notice that it was 2.3.x issue. I am not sure if rails 2.3.8 uses rack for parsing params.
There was another ticket regarding rails edge in which text area having "hello world" will have quotes removed. However "hello \n world" would have quotes preserved. That issue got fixed by that rack commit.
-
Steve Purcell
Rails 2.3.8 indeed appears to require the broken Rack version 1.1.0, whereas 2.3.5 required Rack 1.0.1, so I guess we can assume that this regression is due to the new dependency on a broken Rack.
That's a pity.
-
Subba
- Assigned user set to Neeraj Singh
- Importance changed from to Low
-
Neeraj Singh
- Assigned user changed from Neeraj Singh to Jeremy Kemper
I am not sure if rails 2.3.9 will use the upgraded version of Rack. If it does then this problem will be solved.
-
Steve Purcell
Yeah, I hope so -- as it stands, I've already decided that 2.3.8 isn't safe for production use, since certain user input will get silently truncated, and there's no workaround. Shame that Rails should be compromised by this silly Rack issue.
-
andreas
- Tag changed from 2.3.8, actionpack, params to 2.3.8, 2.3.9, actionpack, params
Can we please get Rails 2.3.9 to use the fixed Rack version?
-
tvdeyen
+1 from me. Have to go back to 2.3.5 for my App now. Then quotes are submitted correctly.
-
Steve Purcell
Confirmed still present in 2.3.9.
I had a go at bumping the Rack version to 1.2.1, but a whole bunch of tests break then.
-
Phil Ross
I've been using the attached initializer to fix this issue with Rails 2.3.8 and 2.3.9. It replaces the parse_query and normalize_params methods in Rack::Utils with fixed versions (the code is from Rack 1.1.0 with the patch from http://github.com/rack/rack/commit/dae12e088592ee69545b5f2f81b87f49... applied).
-
Steve Purcell
Terrific - thanks Phil.
-
caseyf
Ouch.
Phil's initializer helped me. Thanks Phil.
-
Roel van der Hoorn
+1
Nasty bug. Patch works well for me (Rails 2.3.10).
-
Roel van der Hoorn
For those who also ran into this bug: http://groups.google.com/group/rack-devel/browse_thread/thread/5876... you may want to use the attached updated patch, which applies the following two commits:
http://github.com/rack/rack/commit/c028a23b36debbce1005347d4234fe6e...
http://github.com/rack/rack/commit/55cbbc91ae0a03445dd9e0ba1830f70f...
