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:
Steven Sloan 2015-01-15 02:46:59 -05:00
parent ddc048e075
commit a771b15700

View file

@ -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?