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
1 changed files with 1 additions and 1 deletions
|
@ -187,7 +187,7 @@ module Middleman
|
||||||
end
|
end
|
||||||
|
|
||||||
def key?(key)
|
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
|
end
|
||||||
|
|
||||||
alias_method :has_key?, :key?
|
alias_method :has_key?, :key?
|
||||||
|
|
Loading…
Add table
Reference in a new issue