Skip to content

Commit

Permalink
fix ReDoS vulnerability (#185)
Browse files Browse the repository at this point in the history
resolve #184

Co-authored-by: wonda-tea-coffee <[email protected]>
  • Loading branch information
wonda-tea-coffee and wonda-tea-coffee authored Apr 12, 2021
1 parent 1da7562 commit dab95e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_attr/typecasting/boolean_typecaster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def call(value)
case value
when *FALSE_VALUES then false
when *NIL_VALUES then nil
when Numeric, /\A[-+]?(0+\.?0*|0*\.?0+)\z/ then !value.to_f.zero?
when Numeric, /\A[-+]?(0++\.?0*|0*+\.?0+)\z/ then !value.to_f.zero?
else value.present?
end
end
Expand Down

0 comments on commit dab95e5

Please sign in to comment.