Made the cookie handling for the 'expires_soon' cookie insensitive to nonnumeric values.

- Legacy-Id: 9018
This commit is contained in:
Henrik Levkowetz 2015-02-08 10:05:24 +00:00
parent 9f967aebea
commit f3fcf1623d

View file

@ -408,10 +408,11 @@ def new_enough(x,request):
@register.filter(name='expires_soon')
def expires_soon(x,request):
days = 14
if "expires_soon" in request.COOKIES:
days = int(request.COOKIES["expires_soon"])
else:
days = 14
value = request.COOKIES["expires_soon"]
if value.isdigit():
days = int(value)
return x > -days
@register.filter(name='startswith')