This project is archived and is in readonly mode.

#2586 ✓duplicate
Gabriel Sobrinho

2.3.2 text_area_tag doesn't sanitize the id attribute

Reported by Gabriel Sobrinho | April 30th, 2009 @ 07:52 PM | in 2.x

Hello,

Rails version 2.3.2 have a bug on text_area_tag which doesn't sanitize the id attribute. See:


text_area_tag('contact[message]', '', :size => '45x15')

The id attribute should be "contact_message", but the Rails isn't sanitizing it... Well, that is setted to 'contact[message]' literal.

The patch is in form_tag_helper.rb, line 260, change from:


content_tag :textarea, content, { "name" => name, "id" => name }.update(options.stringify_keys)

to


content_tag :textarea, content, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)

Thank you

Comments and changes to this ticket

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

Pages