[epiphany] EphyUriTester: Escape '[' and ']' when converting patterns to regexps



commit 399c6424b2357022d8dac8bde903dba475d3fee1
Author: Emanuele Aina <emanuele aina collabora com>
Date:   Tue Nov 10 16:59:31 2015 +0000

    EphyUriTester: Escape '[' and ']' when converting patterns to regexps
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754954

 embed/web-extension/ephy-uri-tester.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/embed/web-extension/ephy-uri-tester.c b/embed/web-extension/ephy-uri-tester.c
index 5559a6f..7774cf4 100644
--- a/embed/web-extension/ephy-uri-tester.c
+++ b/embed/web-extension/ephy-uri-tester.c
@@ -441,7 +441,9 @@ ephy_uri_tester_fixup_regexp (const char *prefix, char *src)
             g_string_append (str, "\\.");
             break;*/
         case '?':
-          g_string_append (str, "\\?");
+        case '[':
+        case ']':
+          g_string_append_printf (str, "\\%c", *src);
           break;
         case '|':
           /* FIXME: We actually need to match :[0-9]+ or '/'. Sign means


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]