diff options
| author | Josh Mize <jgmize@gmail.com> | 2013-09-09 11:48:56 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-09-09 15:19:09 -0400 |
| commit | a52cc1c0888c2cedb07b2c0619c1a92a2f6e2c40 (patch) | |
| tree | 4644f29ba974e20f06c10080b28bc5d30cd6c81f /django | |
| parent | 910a5760f6f5ffc42b4b264b08057207b8e26106 (diff) | |
Fixed #21078 -- Handled additional bad Accept-Language header
Diffstat (limited to 'django')
| -rw-r--r-- | django/utils/translation/trans_real.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index a6b7eaa489..c7b41fa373 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -668,7 +668,10 @@ def parse_accept_lang_header(lang_string): if first: return [] if priority: - priority = float(priority) + try: + priority = float(priority) + except ValueError: + return [] if not priority: # if priority is 0.0 at this point make it 1.0 priority = 1.0 result.append((lang, priority)) |
