Skip to content
This repository
Browse code

Don't incompatibly monkeypatch ERB.

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit e3f14d12cdad03a2294c8f7d4e170bbaecefe098 1 parent e53791f
Nathan Weizenbaum authored May 23, 2010 jeremy committed May 23, 2010
16  activesupport/lib/active_support/core_ext/string/output_safety.rb
... ...
@@ -1,22 +1,6 @@
1 1
 require 'erb'
2 2
 
3 3
 class ERB
4  
-  undef :set_eoutvar
5  
-  def set_eoutvar(compiler, eoutvar = '_erbout')
6  
-    compiler.put_cmd = "#{eoutvar}.safe_concat"
7  
-    compiler.insert_cmd = "#{eoutvar}.safe_concat"
8  
-
9  
-    cmd = []
10  
-    cmd.push "#{eoutvar} = ActiveSupport::SafeBuffer.new"
11  
-
12  
-    compiler.pre_cmd = cmd
13  
-
14  
-    cmd = []
15  
-    cmd.push(eoutvar)
16  
-
17  
-    compiler.post_cmd = cmd
18  
-  end
19  
-
20 4
   module Util
21 5
     HTML_ESCAPE = { '&' => '&amp;',  '>' => '&gt;',   '<' => '&lt;', '"' => '&quot;' }
22 6
     JSON_ESCAPE = { '&' => '\u0026', '>' => '\u003E', '<' => '\u003C' }

0 notes on commit e3f14d1

Please sign in to comment.
Something went wrong with that request. Please try again.