summaryrefslogtreecommitdiff
path: root/lib/cgi.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cgi.rb')
-rw-r--r--lib/cgi.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 7f40c3a0f6..1b55f0ac95 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -939,7 +939,7 @@ convert string charset, and set language to "ja".
start_pos = lines.rindex(/^\s*<#{element}/ni, end_pos)
lines[start_pos ... end_pos] = "__" + lines[start_pos ... end_pos].gsub(/\n(?!\z)/n, "\n" + shift) + "__"
end
- lines.gsub(/^(\s*)__(?=<\/?\w)/n, '\1')
+ lines.gsub(/^((?:#{Regexp::quote(shift)})*)__(?=<\/?\w)/n, '\1')
end