From acdb712838125d471a41931be8813046606cf835 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Wed, 22 Feb 2006 13:09:33 +0000 Subject: [PATCH] remove FORM FEED and ESC from sent data --- src/common/xmpp/simplexml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/xmpp/simplexml.py b/src/common/xmpp/simplexml.py index b397611ea..0057b472f 100644 --- a/src/common/xmpp/simplexml.py +++ b/src/common/xmpp/simplexml.py @@ -21,7 +21,8 @@ import xml.parsers.expat def XMLescape(txt): """Returns provided string with symbols & < > " replaced by their respective XML entities.""" - return txt.replace("&", "&").replace("<", "<").replace(">", ">").replace('"', """) + # replace also FORM FEED and ESC, because they are not valid XML chars + return txt.replace("&", "&").replace("<", "<").replace(">", ">").replace('"', """).replace(u'\x0C', "").replace(u'\x1B', "") ENCODING='utf-8' def ustr(what):