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.

form_helper corrupts text_fields which have raw html entities

#80

copied from Trac#8116 :

Given the title "The HTML Entity for & is &", the field to edit it should look something like:

 <input id="post_title" name="post[title]" size="30" type="text" value="The HTML Entity for &amp; is &amp;amp;" />

Such strings are correctly escaped in textarea tags, but currently not in text_fields.

I have reformatted this patch by mchenryc

This patch fixes the problem with text fields and adds tests for both text fields and text areas.

Reported by Kevin Glowacz · May 1st, 2008 @ 04:53 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Kyle Hargraves
    Kyle Hargraves

    +1; I was one of the people who updated this patch while it was still on Trac. It's both tested and introduces extra coverage demonstrating current behaviour.

    May 1st, 2008 @ 07:49 PM

  2. Repository
    Repository
    • State changed from new to resolved

    (from [f6ec296ad84ac7e321980cfdd8bba2ea6ce3a14b]) Fixed that TextHelper#text_field would corrypt when raw HTML was used as the value (mchenryc, Kevin Glowacz) [#80 state:resolved]

    http://github.com/rails/rails/co...

    May 1st, 2008 @ 11:56 PM