Skip to content

Commit 6c55b2c

Browse files
committed
Security fix (value for BootstrapUneditableInput widget was not properly escaped)
1 parent 1c92c45 commit 6c55b2c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bootstrap_toolkit/widgets.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from django.conf import settings
33
from django.utils import translation
44
from django.utils.safestring import mark_safe
5+
from django.utils.html import conditional_escape
56

67
default_date_format = getattr(settings, 'DATE_INPUT_FORMATS', None)
78
if default_date_format:
@@ -52,7 +53,7 @@ def render(self, name, value, attrs=None):
5253
klass = add_to_css_class(self.attrs.pop('class', ''), 'uneditable-input')
5354
klass = add_to_css_class(klass, attrs.pop('class', ''))
5455
base = super(BootstrapUneditableInput, self).render(name, value, attrs)
55-
return mark_safe(base + u'<span class="%s">%s</span>' % (klass, value))
56+
return mark_safe(base + u'<span class="%s">%s</span>' % (klass, conditional_escape(value)))
5657

5758

5859
class BootstrapTextInput(forms.TextInput):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='django-bootstrap-toolkit',
5-
version='2.7.0',
5+
version='2.7.1',
66
url='https://github.com/dyve/django-bootstrap-toolkit',
77
author='Dylan Verheul',
88
author_email='[email protected]',

0 commit comments

Comments
 (0)