mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.7.x] Fixed is_safe_url() to handle leading whitespace.
This is a security fix. Disclosure following shortly.
This commit is contained in:
@@ -272,6 +272,7 @@ def is_safe_url(url, host=None):
|
||||
"""
|
||||
if not url:
|
||||
return False
|
||||
url = url.strip()
|
||||
# Chrome treats \ completely as /
|
||||
url = url.replace('\\', '/')
|
||||
# Chrome considers any URL with more than two slashes to be absolute, but
|
||||
|
||||
Reference in New Issue
Block a user