Prevent styles with a "'" character from breaking adblock

This commit is contained in:
Alexander Butenko 2010-01-26 22:03:47 +01:00 committed by Christian Dywan
parent d8dceb657d
commit 7b42792caf

View file

@ -1078,9 +1078,10 @@ adblock_frame_add (gchar* line)
(void)*line++; (void)*line++;
(void)*line++; (void)*line++;
if (strchr (line, ':') if (strchr (line, '\'')
|| (strchr (line, ':')
&& !g_regex_match_simple (".*\\[.*:.*\\].*", line, && !g_regex_match_simple (".*\\[.*:.*\\].*", line,
G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY)) G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY)))
{ {
return; return;
} }
@ -1097,6 +1098,7 @@ adblock_frame_add_private (const gchar* line,
data = g_strsplit (line, sep, 2); data = g_strsplit (line, sep, 2);
if (!(data[1] && *data[1]) if (!(data[1] && *data[1])
|| strchr (data[1], '\'')
|| (strchr (data[1], ':') || (strchr (data[1], ':')
&& !g_regex_match_simple (".*\\[.*:.*\\].*", data[1], && !g_regex_match_simple (".*\\[.*:.*\\].*", data[1],
G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY))) G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY)))