MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / replace_entities

Function replace_entities

thirdparty/clientform/clientform.py:233–248  ·  view source on GitHub ↗
(match, entities=entities, encoding=encoding)

Source from the content-addressed store, hash-verified

231 encoding = None
232
233 def replace_entities(match, entities=entities, encoding=encoding):
234 ent = match.group()
235 if ent[1] == "#":
236 return unescape_charref(ent[2:-1], encoding)
237
238 repl = entities.get(ent)
239 if repl is not None:
240 if hasattr(repl, "decode") and encoding is not None:
241 try:
242 repl = repl.decode(encoding)
243 except UnicodeError:
244 repl = ent
245 else:
246 repl = ent
247
248 return repl
249
250 return re.sub(r"&#?[A-Za-z0-9]+?;", replace_entities, data)
251

Callers

nothing calls this directly

Calls 3

unescape_charrefFunction · 0.85
decodeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…