Jakub Filak 239879b
From 36788b8848f4e263e5e32445b4f51910d2a71419 Mon Sep 17 00:00:00 2001
Jakub Filak 239879b
From: Jakub Filak <jfilak@redhat.com>
Jakub Filak 239879b
Date: Mon, 23 Jun 2014 15:10:24 +0200
Jakub Filak 239879b
Subject: [GNOME-ABRT PATCH] Properly handle UTF-8 problem filter input
Jakub Filak 239879b
Jakub Filak 239879b
Do not compare type dbus.String with encoded type unicode.
Jakub Filak 239879b
Jakub Filak 239879b
Fixes commit be1f8622b26f70b5c153138acbfe10d19e6cef4d
Jakub Filak 239879b
Jakub Filak 239879b
Resolves rhbz#1086037, rbhz#1111820
Jakub Filak 239879b
Jakub Filak 239879b
Signed-off-by: Jakub Filak <jfilak@redhat.com>
Jakub Filak 239879b
---
Jakub Filak 239879b
 src/gnome_abrt/views.py | 8 +++-----
Jakub Filak 239879b
 1 file changed, 3 insertions(+), 5 deletions(-)
Jakub Filak 239879b
Jakub Filak 239879b
diff --git a/src/gnome_abrt/views.py b/src/gnome_abrt/views.py
Jakub Filak 239879b
index 1c30b42..ba65e5b 100644
Jakub Filak 239879b
--- a/src/gnome_abrt/views.py
Jakub Filak 239879b
+++ b/src/gnome_abrt/views.py
Jakub Filak 239879b
@@ -46,7 +46,8 @@ def problems_filter(model, itrtr, data):
Jakub Filak 239879b
         def item_match(pattern, problem):
Jakub Filak 239879b
             for i in ['component', 'reason',
Jakub Filak 239879b
                         'executable', 'package']:
Jakub Filak 239879b
-                val = problem[i]
Jakub Filak 239879b
+                # pattern is 'ascii' and problem[i] is 'dbus.String'
Jakub Filak 239879b
+                val = problem[i].encode('utf-8')
Jakub Filak 239879b
                 if val and pattern in val:
Jakub Filak 239879b
                     return True
Jakub Filak 239879b
 
Jakub Filak 239879b
@@ -747,10 +748,7 @@ _("This problem has been reported, but a Bugzilla ticket has not"
Jakub Filak 239879b
 
Jakub Filak 239879b
     @handle_problem_and_source_errors
Jakub Filak 239879b
     def on_te_search_changed(self, entry):
Jakub Filak 239879b
-        pattern = entry.get_text()
Jakub Filak 239879b
-        if pattern:
Jakub Filak 239879b
-            pattern = pattern.decode('utf-8')
Jakub Filak 239879b
-        self._filter.set_pattern(pattern)
Jakub Filak 239879b
+        self._filter.set_pattern(entry.get_text())
Jakub Filak 239879b
 
Jakub Filak 239879b
     def on_gac_opt_all_problems_activate(self, action):
Jakub Filak 239879b
         conf = config.get_configuration()
Jakub Filak 239879b
-- 
Jakub Filak 239879b
1.8.3.1
Jakub Filak 239879b