Skip to content

Commit

Permalink
Don't incompatibly monkeypatch ERB.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
nex3 authored and jeremy committed May 23, 2010
1 parent e53791f commit e3f14d1
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions activesupport/lib/active_support/core_ext/string/output_safety.rb
@@ -1,22 +1,6 @@
require 'erb'

class ERB
undef :set_eoutvar
def set_eoutvar(compiler, eoutvar = '_erbout')
compiler.put_cmd = "#{eoutvar}.safe_concat"
compiler.insert_cmd = "#{eoutvar}.safe_concat"

cmd = []
cmd.push "#{eoutvar} = ActiveSupport::SafeBuffer.new"

compiler.pre_cmd = cmd

cmd = []
cmd.push(eoutvar)

compiler.post_cmd = cmd
end

module Util
HTML_ESCAPE = { '&' => '&amp;', '>' => '&gt;', '<' => '&lt;', '"' => '&quot;' }
JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003E', '<' => '\u003C' }
Expand Down

0 comments on commit e3f14d1

Please sign in to comment.