This project is archived and is in readonly mode.
Rails inflector "parameterize" vs. + signs
Reported by stijn (at skylight) | March 1st, 2010 @ 08:10 PM | in 2.3.6
I was wondering if it wouldn't be better to not include + signs into the rails "parameterize" as it is used to "replace special characters in a string so that it may be used as part of a ‘pretty’ URL.".
The method can be found in in
active_support/inflector
The regional expression that is used allows + signs;
parameterized_string.gsub!(/[^a-z0-9\-_\+]+/i, sep)
However the + sign can be wrongly identified by the browser, not as a + sign, but as a space. Possibly resulting in errors like;
ArgumentError: illegal character in key
I'll be happy to write a patch and run it through its associated tests if that would help!
Thanks to all you guys for delivering the best framework ever!
Comments and changes to this ticket
-
stijn (at skylight) March 5th, 2010 @ 06:53 AM
- Tag set to patch
This is the fix for the described problem for the 2-3-stable branch. I'll try to add one as well for master branch as well.
-
stijn (at skylight) March 5th, 2010 @ 07:06 AM
And here is the fix for the master branch.
Is it normal that the patch file for 2-3 stable is so big and this one is so small?
-
Santiago Pastorino March 5th, 2010 @ 10:08 PM
- State changed from new to verified
- Tag changed from patch to 2.3.x, 3.0, patch
- Milestone set to 2.3.6
stijn master patch works fine.
I'm providing the right 2-3-stable patch with Stijn Mathysen stijn@skylight.be as the author. -
Repository March 5th, 2010 @ 10:11 PM
- State changed from verified to committed
(from [f6f75e84c5a186ea4c689dd8b7ae0da391c226ef]) Removed the + sign as an accepted character from the parameterize method, as a + sign is interpreted by the browser as a space, possibly resulting in a "ArgumentError: illegal character in key"
[#4080 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/f6f75e84c5a186ea4c689dd8b7ae0d... -
Repository March 5th, 2010 @ 10:11 PM
(from [67512b9489593ddcd1c0c87ba0052380355b5400]) Removed the + sign as an accepted character from the parameterize method, as a + sign is interpreted by the browser as a space, possibly resulting in a "ArgumentError: illegal character in key"
[#4080 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/67512b9489593ddcd1c0c87ba00523...
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>
People watching this ticket
Attachments
Referenced by
- 4080 Rails inflector "parameterize" vs. + signs [#4080 state:committed]
- 4080 Rails inflector "parameterize" vs. + signs [#4080 state:committed]