Use html.escape() instead of cgi.escape()

This commit is contained in:
Sajith Sasidharan 2020-08-27 21:52:48 -04:00
parent 894195dd37
commit 9dc02881ef

View File

@ -1,6 +1,6 @@
from __future__ import print_function
import os.path, re, urllib, time, cgi
import os.path, re, urllib, time
import json
import treq
import html
@ -365,7 +365,7 @@ class WebMixin(TimezoneMixin):
self._htmlname_raw = self._htmlname_unicode.encode('utf-8')
self._htmlname_urlencoded = urllib.quote(self._htmlname_raw, '')
self._htmlname_escaped = html.escape(self._htmlname_raw)
self._htmlname_escaped_attr = cgi.escape(self._htmlname_raw, quote=True)
self._htmlname_escaped_attr = html.escape(self._htmlname_raw, quote=True)
self._htmlname_escaped_double = html.escape(html.escape(self._htmlname_raw, quote=True))
self.HTMLNAME_CONTENTS, n, self._htmlname_txt_uri = self.makefile(0)
foo.set_uri(self._htmlname_unicode, self._htmlname_txt_uri, self._htmlname_txt_uri)