mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +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
1 changed files with 5 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
||||||
# See LICENSE for more details.
|
# See LICENSE for more details.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import cgi
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
|
@ -94,10 +95,11 @@ class DetailsTab(Tab):
|
||||||
txt = status[widget[2][0]]
|
txt = status[widget[2][0]]
|
||||||
|
|
||||||
if widget[0].get_text() != txt:
|
if widget[0].get_text() != txt:
|
||||||
if widget[2][0] == 'comment' and is_url(txt):
|
txt = cgi.escape(txt)
|
||||||
widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt.replace('&', '&')))
|
if widget[2][0] == "comment" and is_url(txt):
|
||||||
|
widget[0].set_markup('<a href="%s">%s</a>' % (txt, txt))
|
||||||
else:
|
else:
|
||||||
widget[0].set_markup(txt.replace('&', '&'))
|
widget[0].set_markup(txt)
|
||||||
|
|
||||||
def clear(self):
|
def clear(self):
|
||||||
for widget in self.label_widgets:
|
for widget in self.label_widgets:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue