mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
cap integer range
This commit is contained in:
parent
b7ac164afd
commit
b44e1c7765
1 changed files with 4 additions and 1 deletions
|
@ -17,7 +17,10 @@ defmodule Philomena.Search.Helpers do
|
|||
def to_int(term) do
|
||||
{int, _} = :string.to_integer(term)
|
||||
|
||||
int
|
||||
case int in -2_147_483_648..2_147_483_647 do
|
||||
true -> int
|
||||
_false -> 0
|
||||
end
|
||||
end
|
||||
|
||||
def range([center, deviation]) do
|
||||
|
|
Loading…
Reference in a new issue