This project is archived and is in readonly mode.
Monkey patched ERB breaks other libraries relying on standard behaviour from ERB.
Reported by Aslak Hellesøy | February 22nd, 2010 @ 12:54 PM | in 2.3.8
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.
Comments and changes to this ticket
-
Aslak Hellesøy February 22nd, 2010 @ 05:00 PM
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
-
Aslak Hellesøy February 22nd, 2010 @ 05:04 PM
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...
-
José Valim February 23rd, 2010 @ 09:10 PM
- Assigned user set to Yehuda Katz (wycats)
- Milestone cleared.
-
Yehuda Katz (wycats) February 23rd, 2010 @ 09:51 PM
- State changed from new to open
Aslak, this patch looks good. Can you rebase against master?
-
José Valim March 22nd, 2010 @ 09:52 PM
- State changed from open to invalid
The hacks were removed in master. Aslak, please reopen if you find more issues!
-
Jeremy Kemper May 23rd, 2010 @ 09:52 PM
- Milestone set to 2.3.7
- State changed from invalid to incomplete
But the hacks were not removed from 2-3-stable.
-
Jeremy Kemper May 25th, 2010 @ 01:28 AM
- State changed from incomplete to resolved
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>