lib/chartkick/helper.rb in chartkick-5.0.6 vs lib/chartkick/helper.rb in chartkick-5.1.0

- old
+ new

@@ -76,10 +76,10 @@ [:height, :width].each do |k| # limit to alphanumeric and % for simplicity # this prevents things like calc() but safety is the priority # dot does not need escaped in square brackets - raise ArgumentError, "Invalid #{k}" unless html_vars[k] =~ /\A[a-zA-Z0-9%.]*\z/ + raise ArgumentError, "Invalid #{k}" unless /\A[a-zA-Z0-9%.]*\z/.match?(html_vars[k]) end html_vars.each_key do |k| # escape all variables # we already limit height and width above, but escape for safety as fail-safe