Skip to content

Commit

Permalink
RecentConns: Alias may contain < > which causes parse errors
Browse files Browse the repository at this point in the history
For example in the StatusNotifierItem.

fixes #2429
  • Loading branch information
infirit committed Jul 24, 2024
1 parent 1796448 commit 92cc6fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion blueman/plugins/applet/RecentConns.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from gettext import gettext as _
from operator import itemgetter
import html
import time
import logging
from typing import List, TYPE_CHECKING, Optional, Callable, cast, Union
Expand Down Expand Up @@ -167,8 +168,9 @@ def err(reason: Union[Exception, str]) -> None:
self.parent.Plugins.DBusService.connect_service(item["device"], item["uuid"], reply, err)

def _build_menu_item(self, item: "Item") -> "SubmenuItemDict":
alias = html.escape(item["alias"])
mitem: "SubmenuItemDict" = {
"text": _("%(service)s on %(device)s") % {"service": item["name"], "device": item["alias"]},
"text": _("%(service)s on %(device)s") % {"service": item["name"], "device": alias},
"markup": True,
"icon_name": item["mitem"]["icon_name"] if item["mitem"] is not None else item["icon"],
"sensitive": item["device"] is not None,
Expand Down

0 comments on commit 92cc6fc

Please sign in to comment.