Made the cookie handling for the 'expires_soon' cookie insensitive to nonnumeric values.
- Legacy-Id: 9018
This commit is contained in:
parent
9f967aebea
commit
f3fcf1623d
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue