Skip to content

Commit 7a55ebf

Browse files
authored
xml escape ampersands to avoid XML parse error on valid urls.
1 parent 768f794 commit 7a55ebf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

djangosaml2/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def get_location(http_info):
5151
def get_hidden_form_inputs(html):
5252
""" Extracts name/value pairs from hidden input tags in an html form."""
5353
pairs = dict()
54-
tree = ElementTree.fromstring(html, forbid_dtd=True)
54+
tree = ElementTree.fromstring(html.replace('&', '&'), forbid_dtd=True)
5555
# python 2.6 doesn't have iter
5656
if hasattr(tree, 'iter'):
5757
node_iter = tree.iter()

0 commit comments

Comments
 (0)