diff options
author | Fred Drake <fdrake@acm.org> | 2002-10-28 17:46:59 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-10-28 17:46:59 (GMT) |
commit | 407fea5197cc684a4941d3b47b018c1a80314223 (patch) | |
tree | bd79fae4a4d11c3bb6b42958bf968115f58e9cb8 /Lib/xml | |
parent | f55222d98fd08c469a447ee18c2922b763794fa2 (diff) | |
download | cpython-407fea5197cc684a4941d3b47b018c1a80314223.zip cpython-407fea5197cc684a4941d3b47b018c1a80314223.tar.gz cpython-407fea5197cc684a4941d3b47b018c1a80314223.tar.bz2 |
Really do replacement of & last to avoid bad interactions between &
replacement and replacements based on the entities parameter.
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/sax/saxutils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/xml/sax/saxutils.py b/Lib/xml/sax/saxutils.py index 049e09c..035715c 100644 --- a/Lib/xml/sax/saxutils.py +++ b/Lib/xml/sax/saxutils.py @@ -43,10 +43,10 @@ def unescape(data, entities={}): """ data = data.replace("<", "<") data = data.replace(">", ">") - # must do ampersand last - data = data.replace("&", "&") if entities: data = __dict_replace(data, entities) + # must do ampersand last + data = data.replace("&", "&") return data def quoteattr(data, entities={}): |