mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-09 09:58:39 +00:00
Use xml.sax instead of cgi for escaping
This commit is contained in:
parent
56f5ce6ee1
commit
82ac1bdfe0
1 changed files with 2 additions and 2 deletions
|
@ -7,8 +7,8 @@
|
||||||
# See LICENSE for more details.
|
# See LICENSE for more details.
|
||||||
#
|
#
|
||||||
|
|
||||||
import cgi
|
|
||||||
import logging
|
import logging
|
||||||
|
from xml.sax.saxutils import escape as xml_escape
|
||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
from deluge.common import fdate, fsize, is_url
|
from deluge.common import fdate, fsize, is_url
|
||||||
|
@ -93,9 +93,9 @@ class DetailsTab(Tab):
|
||||||
txt = widget[1](*args)
|
txt = widget[1](*args)
|
||||||
else:
|
else:
|
||||||
txt = status[widget[2][0]]
|
txt = status[widget[2][0]]
|
||||||
|
txt = xml_escape(txt)
|
||||||
|
|
||||||
if widget[0].get_text() != txt:
|
if widget[0].get_text() != txt:
|
||||||
txt = cgi.escape(txt)
|
|
||||||
if widget[2][0] == "comment" and is_url(txt):
|
if widget[2][0] == "comment" and is_url(txt):
|
||||||
widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt))
|
widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue