X-Git-Url: http://www.privoxy.org/gitweb/show-status?a=blobdiff_plain;f=actions.c;h=379c5e97b4ad6ad807960aaafd17fc797dc29163;hb=1603ca22d9a21bc6f0a181994e6971fd62cd3697;hp=087f59db268aa600381a35cf362a3d03a157af61;hpb=6235cc02e3f789fd39b1d72fadeb776ec3920572;p=privoxy.git
diff --git a/actions.c b/actions.c
index 087f59db..379c5e97 100644
--- a/actions.c
+++ b/actions.c
@@ -828,8 +828,12 @@ int update_action_bits_for_tag(struct client_state *csp, const char *tag)
continue;
}
+#ifdef HAVE_PCRE2
+ if (pcre2_pattern_matches(b->url->pattern.tag_regex, tag))
+#else
/* and check if one of the tag patterns matches the tag, */
if (0 == regexec(b->url->pattern.tag_regex, tag, 0, NULL, 0))
+#endif
{
/* if it does, update the action bit map, */
if (merge_current_action(csp->action, b->action))
@@ -884,7 +888,11 @@ jb_err check_negative_tag_patterns(struct client_state *csp, unsigned int flag)
}
for (tag = csp->tags->first; NULL != tag; tag = tag->next)
{
+#ifdef HAVE_PCRE2
+ if (pcre2_pattern_matches(b->url->pattern.tag_regex, tag->str))
+#else
if (0 == regexec(b->url->pattern.tag_regex, tag->str, 0, NULL, 0))
+#endif
{
/*
* The pattern matches at least one tag, thus the action
@@ -1111,6 +1119,14 @@ static const char *filter_type_to_string(enum filter_type filter_type)
return "client-header tagger";
case FT_SERVER_HEADER_TAGGER:
return "server-header tagger";
+ case FT_SUPPRESS_TAG:
+ return "suppress tag filter";
+ case FT_CLIENT_BODY_FILTER:
+ return "client body filter";
+ case FT_CLIENT_BODY_TAGGER:
+ return "client body tagger";
+ case FT_ADD_HEADER:
+ return "add-header action";
#ifdef FEATURE_EXTERNAL_FILTERS
case FT_EXTERNAL_CONTENT_FILTER:
return "external content filter";
@@ -1185,7 +1201,8 @@ static int action_spec_is_valid(struct client_state *csp, const struct action_sp
{ACTION_MULTI_CLIENT_HEADER_FILTER, FT_CLIENT_HEADER_FILTER},
{ACTION_MULTI_SERVER_HEADER_FILTER, FT_SERVER_HEADER_FILTER},
{ACTION_MULTI_CLIENT_HEADER_TAGGER, FT_CLIENT_HEADER_TAGGER},
- {ACTION_MULTI_SERVER_HEADER_TAGGER, FT_SERVER_HEADER_TAGGER}
+ {ACTION_MULTI_SERVER_HEADER_TAGGER, FT_SERVER_HEADER_TAGGER},
+ {ACTION_MULTI_CLIENT_BODY_FILTER, FT_CLIENT_BODY_FILTER}
};
int errors = 0;
int i;
@@ -1205,7 +1222,7 @@ static int action_spec_is_valid(struct client_state *csp, const struct action_sp
*
* Function : load_one_actions_file
*
- * Description : Read and parse a action file and add to files
+ * Description : Read and parse an action file and add to files
* list.
*
* Parameters :
@@ -1639,7 +1656,7 @@ int load_one_actions_file(struct client_state *csp, int fileid)
*
* Function : actions_to_text
*
- * Description : Converts a actionsfile entry from the internal
+ * Description : Converts an actionsfile entry from the internal
* structure into a text line. The output is split
* into one line for each action with line continuation.
*
@@ -1725,7 +1742,7 @@ char * actions_to_text(const struct action_spec *action)
*
* Function : actions_to_html
*
- * Description : Converts a actionsfile entry from numeric form
+ * Description : Converts an actionsfile entry from numeric form
* ("mask" and "add") to a
-separated HTML string
* in which each action is linked to its chapter in
* the user manual.
@@ -1832,7 +1849,7 @@ char * actions_to_html(const struct client_state *csp,
*
* Function : current_actions_to_html
*
- * Description : Converts a curren action spec to a
separated HTML
+ * Description : Converts a current action spec to a
separated HTML
* text in which each action is linked to its chapter in
* the user manual.
*
@@ -1928,7 +1945,7 @@ char *current_action_to_html(const struct client_state *csp,
*
* Function : action_to_line_of_text
*
- * Description : Converts a action spec to a single text line
+ * Description : Converts an action spec to a single text line
* listing the enabled actions.
*
* Parameters :