From 7b42792caf38b4c632f1423889caee610eccecee Mon Sep 17 00:00:00 2001 From: Alexander Butenko Date: Tue, 26 Jan 2010 22:03:47 +0100 Subject: [PATCH] Prevent styles with a "'" character from breaking adblock --- extensions/adblock.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extensions/adblock.c b/extensions/adblock.c index 25504197..c7af950e 100644 --- a/extensions/adblock.c +++ b/extensions/adblock.c @@ -1078,9 +1078,10 @@ adblock_frame_add (gchar* line) (void)*line++; (void)*line++; - if (strchr (line, ':') + if (strchr (line, '\'') + || (strchr (line, ':') && !g_regex_match_simple (".*\\[.*:.*\\].*", line, - G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY)) + G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))) { return; } @@ -1097,6 +1098,7 @@ adblock_frame_add_private (const gchar* line, data = g_strsplit (line, sep, 2); if (!(data[1] && *data[1]) + || strchr (data[1], '\'') || (strchr (data[1], ':') && !g_regex_match_simple (".*\\[.*:.*\\].*", data[1], G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))) -- 2.39.5