mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 20:14:13 +00:00
[#2702] [GTKUI] Fix potential markup warning in Details Tab
* Comments with HTML markup cause a GTK markup warning. * Use cgi function to escape '&', '<' and '>' to prevent pango markup error.
This commit is contained in:
parent
0ea6ad0669
commit
41f08e4e29
@ -7,6 +7,7 @@
|
||||
# See LICENSE for more details.
|
||||
#
|
||||
|
||||
import cgi
|
||||
import logging
|
||||
|
||||
import deluge.component as component
|
||||
@ -94,10 +95,11 @@ class DetailsTab(Tab):
|
||||
txt = status[widget[2][0]]
|
||||
|
||||
if widget[0].get_text() != txt:
|
||||
if widget[2][0] == 'comment' and is_url(txt):
|
||||
widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt.replace('&', '&')))
|
||||
txt = cgi.escape(txt)
|
||||
if widget[2][0] == "comment" and is_url(txt):
|
||||
widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt))
|
||||
else:
|
||||
widget[0].set_markup(txt.replace('&', '&'))
|
||||
widget[0].set_markup(txt)
|
||||
|
||||
def clear(self):
|
||||
for widget in self.label_widgets:
|
||||
|
Loading…
x
Reference in New Issue
Block a user