diff options
Diffstat (limited to 'django/utils/html.py')
| -rw-r--r-- | django/utils/html.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/html.py b/django/utils/html.py index 5dd67fd151..4514759d81 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -186,8 +186,8 @@ def strip_tags(value): value = str(value) while '<' in value and '>' in value: new_value = _strip_once(value) - if len(new_value) >= len(value): - # _strip_once was not able to detect more tags + if value.count('<') == new_value.count('<'): + # _strip_once wasn't able to detect more tags. break value = new_value return value |
