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

- Legacy-Id: 9009
This commit is contained in:
Henrik Levkowetz 2015-02-06 10:57:17 +00:00
parent 6ec0e9ba6a
commit 05a617d3b2

View file

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