From c945f51552d10e3b7e8e8525fa43c706e43ec4e1 Mon Sep 17 00:00:00 2001 From: makoto kuwata Date: Wed, 23 Feb 2011 13:40:59 +0900 Subject: [bugfix] 'InterporationEnhancer#_add_text_to_str()' raised null-pointer-exception in a certain case --- lib/erubis/enhancer.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/erubis/enhancer.rb b/lib/erubis/enhancer.rb index 361a582..2fa2862 100644 --- a/lib/erubis/enhancer.rb +++ b/lib/erubis/enhancer.rb @@ -706,8 +706,7 @@ module Erubis def _add_text_to_str(str, text) return if !text || text.empty? - text.gsub!(/[`\#\\]/, '\\\\\&') - str << text + str << text.gsub(/[`\#\\]/, '\\\\\&') end def add_expr_escaped(str, code) -- cgit v1.2.1