Limit how much blocks can be nested during parsing (#894)

This commit is contained in:
Dylan Thacker-Smith
2017-05-11 09:37:53 -04:00
committed by GitHub
parent 62d4625468
commit 9c72ccb82f
5 changed files with 37 additions and 12 deletions
+2 -1
View File
@@ -1,12 +1,13 @@
module Liquid
class ParseContext
attr_accessor :locale, :line_number, :trim_whitespace
attr_accessor :locale, :line_number, :trim_whitespace, :depth
attr_reader :partial, :warnings, :error_mode
def initialize(options = {})
@template_options = options ? options.dup : {}
@locale = @template_options[:locale] ||= I18n.new
@warnings = []
self.depth = 0
self.partial = false
end