X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=cgisimple.c;h=962a9de91250bafafd172702b0a679a9864e363f;hb=9c0440416d2af8c052d5d1941afbec22b6d68125;hp=54d4eec668a26cfb9a26a22ad846ac5e81d8281d;hpb=d96a70ba6c5ec0ef091631299286b20d7af40ca2;p=privoxy.git diff --git a/cgisimple.c b/cgisimple.c index 54d4eec6..962a9de9 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.26 2002/04/04 00:36:36 gliptak Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.28 2002/04/07 15:42:12 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -36,6 +36,13 @@ const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.26 2002/04/04 00:36:36 glipta * * Revisions : * $Log: cgisimple.c,v $ + * Revision 1.28 2002/04/07 15:42:12 jongfoster + * Fixing send-banner?type=auto when the image-blocker is + * a redirect to send-banner + * + * Revision 1.27 2002/04/05 15:50:48 oes + * added send-stylesheet CGI + * * Revision 1.26 2002/04/04 00:36:36 gliptak * always use pcre for matching * @@ -425,18 +432,33 @@ jb_err cgi_send_banner(struct client_state *csp, #ifdef FEATURE_IMAGE_BLOCKING if ((csp->action->flags & ACTION_IMAGE_BLOCKER) != 0) { + static const char prefix1[] = CGI_PREFIX "send-banner?type="; + static const char prefix2[] = "http://" CGI_SITE_1_HOST "/send-banner?type="; + /* determine HOW images should be blocked */ const char * p = csp->action->string[ACTION_STRING_IMAGE_BLOCKER]; /* and handle accordingly: */ - if ((p != NULL) && (0 == strcmpic(p, "blank"))) + if (p == NULL) + { + /* Use default - nothing to do here. */ + } + else if (0 == strcmpic(p, "blank")) { imagetype = 'b'; } - else if ((p != NULL) && (0 == strcmpic(p, "pattern"))) + else if (0 == strcmpic(p, "pattern")) { imagetype = 'p'; } + else if (0 == strncmpic(p, prefix1, sizeof(prefix1) - 1)) + { + imagetype = p[sizeof(prefix1) - 1]; + } + else if (0 == strncmpic(p, prefix2, sizeof(prefix2) - 1)) + { + imagetype = p[sizeof(prefix2) - 1]; + } } #endif /* def FEATURE_IMAGE_BLOCKING */ } @@ -538,7 +560,7 @@ jb_err cgi_send_stylesheet(struct client_state *csp, assert(csp); assert(rsp); - err = template_load(csp, &rsp->body, "cgi-style.css"); + err = template_load(csp, &rsp->body, "cgi-style.css", 0); if (err == JB_ERR_FILE) {