mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Disallow appended newlines when parsing as integer
\Z allows appended newlines where \z does not.
This commit is contained in:
parent
4cd57a88b4
commit
4e511001b4
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ module ActiveModel
|
|||
end
|
||||
|
||||
def parse_raw_value_as_an_integer(raw_value)
|
||||
raw_value.to_i if raw_value.to_s =~ /\A[+-]?\d+\Z/
|
||||
raw_value.to_i if raw_value.to_s =~ /\A[+-]?\d+\z/
|
||||
end
|
||||
|
||||
def filtered_options(value)
|
||||
|
|
Loading…
Reference in a new issue