rewrite CoreExtension::Data#key? to prevent potential SystemStackError
since data_for_path can trigger respond_to?, and respond_to? uses key? — a SystemStackError could trigger if data_for_path was called.
This commit is contained in:
parent
ddc048e075
commit
a771b15700
|
@ -187,7 +187,7 @@ module Middleman
|
|||
end
|
||||
|
||||
def key?(key)
|
||||
@local_data.key?(key.to_s) || data_for_path(key)
|
||||
( @local_data.keys + @local_sources.keys + @callback_sources.keys ).include?(key.to_s)
|
||||
end
|
||||
|
||||
alias_method :has_key?, :key?
|
||||
|
|
Loading…
Reference in a new issue