From ff52254924ef9ba6eac7b08402bcef7c03603e30 Mon Sep 17 00:00:00 2001 From: Martijn Voncken Date: Sat, 4 Oct 2008 10:20:08 +0000 Subject: [PATCH] sanitize filter_dict input --- deluge/core/filtermanager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/deluge/core/filtermanager.py b/deluge/core/filtermanager.py index cc86de001..ea97426a5 100644 --- a/deluge/core/filtermanager.py +++ b/deluge/core/filtermanager.py @@ -70,6 +70,12 @@ class FilterManager(component.Component): if not filter_dict: return self.torrents.get_torrent_list() + #sanitize input: filter-value must be a list of strings + for key, value in filter_dict.items(): + if isinstance(value, str): + filter_dict[key] = [value] + + if "id"in filter_dict: #optimized filter for id: torrent_ids = filter_dict["id"] del filter_dict["id"]