mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Fix for a privately reported bug
This commit is contained in:
40
thirdparty/beautifulsoup/beautifulsoup.py
vendored
40
thirdparty/beautifulsoup/beautifulsoup.py
vendored
@@ -512,25 +512,29 @@ class Tag(PageElement):
|
||||
entities with the appropriate Unicode characters. If HTML
|
||||
entities are being converted, any unrecognized entities are
|
||||
escaped."""
|
||||
x = match.group(1)
|
||||
if self.convertHTMLEntities and x in name2codepoint:
|
||||
return unichr(name2codepoint[x])
|
||||
elif x in self.XML_ENTITIES_TO_SPECIAL_CHARS:
|
||||
if self.convertXMLEntities:
|
||||
return self.XML_ENTITIES_TO_SPECIAL_CHARS[x]
|
||||
else:
|
||||
return u'&%s;' % x
|
||||
elif len(x) > 0 and x[0] == '#':
|
||||
# Handle numeric entities
|
||||
if len(x) > 1 and x[1] == 'x':
|
||||
return unichr(int(x[2:], 16))
|
||||
else:
|
||||
return unichr(int(x[1:]))
|
||||
try:
|
||||
x = match.group(1)
|
||||
if self.convertHTMLEntities and x in name2codepoint:
|
||||
return unichr(name2codepoint[x])
|
||||
elif x in self.XML_ENTITIES_TO_SPECIAL_CHARS:
|
||||
if self.convertXMLEntities:
|
||||
return self.XML_ENTITIES_TO_SPECIAL_CHARS[x]
|
||||
else:
|
||||
return u'&%s;' % x
|
||||
elif len(x) > 0 and x[0] == '#':
|
||||
# Handle numeric entities
|
||||
if len(x) > 1 and x[1] == 'x':
|
||||
return unichr(int(x[2:], 16))
|
||||
else:
|
||||
return unichr(int(x[1:]))
|
||||
|
||||
elif self.escapeUnrecognizedEntities:
|
||||
return u'&%s;' % x
|
||||
else:
|
||||
return u'&%s;' % x
|
||||
elif self.escapeUnrecognizedEntities:
|
||||
return u'&%s;' % x
|
||||
|
||||
except ValueError: # e.g. ValueError: unichr() arg not in range(0x10000)
|
||||
pass
|
||||
|
||||
return u'&%s;' % x
|
||||
|
||||
def __init__(self, parser, name, attrs=None, parent=None,
|
||||
previous=None):
|
||||
|
||||
Reference in New Issue
Block a user