Skip to content

Commit

Permalink
Improved code [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Jun 18, 2024
1 parent c3b3926 commit e3cdfec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/chartkick/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def chartkick_chart(klass, data_source, **options)
# 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|
Expand Down

0 comments on commit e3cdfec

Please sign in to comment.