From: Fabian Keil <fk@fabiankeil.de>
Date: Tue, 3 Jun 2014 10:33:17 +0000 (+0000)
Subject: Let +external-filter{} only filter "text" by default
X-Git-Tag: v_3_0_22~121
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/man-page/faq/@default-cgi@send-stylesheet?a=commitdiff_plain;h=ec87f837d4ead511a94466661b8afff643e0d207;p=privoxy.git

Let +external-filter{} only filter "text" by default

Given that this is what +filter{} does, it's probably
the expected behaviour.
---

diff --git a/filters.c b/filters.c
index 7b18e352..31f528e7 100644
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.182 2014/06/02 06:22:20 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.183 2014/06/03 10:29:40 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -2252,7 +2252,9 @@ char *execute_content_filters(struct client_state *csp)
    content = (content_filter != NULL) ? (*content_filter)(csp) : NULL;
 
 #ifdef FEATURE_EXTERNAL_FILTERS
-   if (!list_is_empty(csp->action->multi[ACTION_MULTI_EXTERNAL_FILTER]))
+   if ((csp->content_type & CT_TEXT) &&
+       (csp->rlist != NULL) &&
+       !list_is_empty(csp->action->multi[ACTION_MULTI_EXTERNAL_FILTER]))
    {
       struct list_entry *filtername;
       size_t size = (size_t)csp->content_length;
@@ -2654,7 +2656,8 @@ int content_requires_filtering(struct client_state *csp)
     */
    if ((csp->content_type & CT_TEXT) &&
        (csp->rlist != NULL) &&
-       (!list_is_empty(csp->action->multi[ACTION_MULTI_FILTER])))
+       (!list_is_empty(csp->action->multi[ACTION_MULTI_FILTER]) ||
+        !list_is_empty(csp->action->multi[ACTION_MULTI_EXTERNAL_FILTER])))
    {
       return TRUE;
    }
@@ -2664,7 +2667,7 @@ int content_requires_filtering(struct client_state *csp)
       return TRUE;
    }
 
-   return (!list_is_empty(csp->action->multi[ACTION_MULTI_EXTERNAL_FILTER]));
+   return FALSE;
 
 }