X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=cgisimple.c;h=46ffb1518a528d1e57e67472e1adc6e5670ce9d4;hb=eaf23dabd8a7326e6cdae80a99f10bda0c3ec731;hp=c01ae09184729f8956771eaa14569019de8e3e0b;hpb=fecef4ea125ac93e7a0bd832b5f270a2ab5dfdaf;p=privoxy.git diff --git a/cgisimple.c b/cgisimple.c index c01ae091..46ffb151 100644 --- a/cgisimple.c +++ b/cgisimple.c @@ -1,4 +1,4 @@ -const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.96 2009/12/16 08:36:39 fabiankeil Exp $"; +const char cgisimple_rcs[] = "$Id: cgisimple.c,v 1.98 2010/03/27 18:29:59 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgisimple.c,v $ @@ -1078,7 +1078,7 @@ jb_err cgi_show_url_info(struct client_state *csp, * 1) "http://" or "https://" prefix present and followed by URL - OK * 2) Only the "http://" or "https://" part is present, no URL - change * to empty string so it will be detected later as "no URL". - * 3) Parameter specified but doesn't contain "http(s?)://" - add a + * 3) Parameter specified but doesn't start with "http(s?)://" - add a * "http://" prefix. * 4) Parameter not specified or is empty string - let this fall through * for now, next block of code will handle it. @@ -1105,9 +1105,14 @@ jb_err cgi_show_url_info(struct client_state *csp, url_param[0] = '\0'; } } - else if ((url_param[0] != '\0') && (NULL == strstr(url_param, "://"))) + else if ((url_param[0] != '\0') + && ((NULL == strstr(url_param, "://") + || (strstr(url_param, "://") > strstr(url_param, "/"))))) { - /* No prefix - assume http:// */ + /* + * No prefix or at least no prefix before + * the first slash - assume http:// + */ char *url_param_prefixed = strdup("http://"); if (JB_ERR_OK != string_join(&url_param_prefixed, url_param))