[epiphany/gnome-3-18] EphyUriTester: Escape '[' and ']' when converting patterns to regexps



commit 1069551de7264ab016d9d64bca5f37b596029f8c
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/uri-tester.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/embed/web-extension/uri-tester.c b/embed/web-extension/uri-tester.c
index aa6b58c..c62bedb 100644
--- a/embed/web-extension/uri-tester.c
+++ b/embed/web-extension/uri-tester.c
@@ -438,7 +438,9 @@ 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]