Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

2.3.2 text_area_tag doesn't sanitize the id attribute

#2586

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

Reported by Gabriel Sobrinho · April 30th, 2009 @ 07:52 PM

State: duplicate
Milestone: 2.x
Assigned to: nobody
Importance: none