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.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

Monkey patched ERB breaks other libraries relying on standard behaviour from ERB.

#4034

This monkey patch of ERB causes ERB to behave differently than Ruby standard library's ERB - everything is escaped by default.

This causes problems for e.g. Cucumber, which preprocesses Treetop grammar files with ERB at runtime. Since ERB now behaves in a non-standard way this breaks Cucumber.

Intead of monkey-patching ERB, Rails should define a subclass of ERB with the overridden behaviour, and use that internally.

Reported by Aslak Hellesøy · February 22nd, 2010 @ 12:54 PM

State: resolved
Milestone: 2.3.8
Assigned to: Yehuda Katz (wycats) Yehuda Katz (wycats)
Importance: High

Activity

  1. Aslak Hellesøy
    Aslak Hellesøy

    I have added a test to reproduce this here: http://github.com/aslakhellesoy/rails/commit/13d11f7b7033fee328d99c...
    The fix is here: http://github.com/aslakhellesoy/rails/commit/30416d3cdc6863af444ea9...

    (Those two commits should ideally have been done in the opposite order, but you get the idea).

    The fix is on my 2-3-stable-4034-dont-monkeypatch-erb branch

    February 22nd, 2010 @ 05:00 PM

  2. Aslak Hellesøy
    Aslak Hellesøy

    FWIW - here is the original ticket that was reported in Cucumber. It has a link to a gist that shows an example of how this bug manifests itself.

    https://rspec.lighthouseapp.com/projects/16211/tickets/577-breakage...

    February 22nd, 2010 @ 05:04 PM

  3. José Valim
    José Valim
    • Assigned user set to Yehuda Katz (wycats)
    • Milestone cleared.

    February 23rd, 2010 @ 09:10 PM

  4. Yehuda Katz (wycats)
    Yehuda Katz (wycats)
    • State changed from new to open

    Aslak, this patch looks good. Can you rebase against master?

    February 23rd, 2010 @ 09:51 PM

  5. José Valim
    José Valim
    • State changed from open to invalid

    The hacks were removed in master. Aslak, please reopen if you find more issues!

    March 22nd, 2010 @ 09:52 PM

  6. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 2.3.7
    • State changed from invalid to incomplete

    But the hacks were not removed from 2-3-stable.

    May 23rd, 2010 @ 09:52 PM

  7. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.7 to 2.3.8

    May 24th, 2010 @ 09:40 AM

  8. Jeremy Kemper
    Jeremy Kemper
    • State changed from incomplete to resolved

    May 25th, 2010 @ 01:28 AM

  9. Aslak Hellesøy