Index: lib/util_str.c =================================================================== RCS file: /home/cvs/samba/source/lib/util_str.c,v retrieving revision 1.47.2.49 diff -u -r1.47.2.49 util_str.c --- lib/util_str.c 22 Nov 2003 04:33:35 -0000 1.47.2.49 +++ lib/util_str.c 24 Dec 2003 09:47:57 -0000 @@ -1780,11 +1780,6 @@ { char *p=buf; - while ((p=strchr_m(p,'+'))) - *p = ' '; - - p = buf; - while (p && *p && (p=strchr_m(p,'%'))) { int c1 = p[1]; int c2 = p[2]; Index: web/cgi.c =================================================================== RCS file: /home/cvs/samba/source/web/cgi.c,v retrieving revision 1.58.2.13 diff -u -r1.58.2.13 cgi.c --- web/cgi.c 22 Nov 2003 06:16:01 -0000 1.58.2.13 +++ web/cgi.c 24 Dec 2003 09:47:57 -0000 @@ -85,6 +85,20 @@ return ret; } +/** + URL encoded strings can have a '+', which should be replaced with a space + + (This was in rfc1738_unescape(), but that broke the squid helper) +**/ + +void plus_to_space_unescape(char *buf) +{ + char *p=buf; + + while ((p=strchr_m(p,'+'))) + *p = ' '; +} + /*************************************************************************** load all the variables passed to the CGI program. May have multiple variables with the same name and the same or different values. Takes a file parameter @@ -130,7 +144,9 @@ !variables[num_variables].value) continue; + plus_to_space_unescape(variables[num_variables].value); rfc1738_unescape(variables[num_variables].value); + plus_to_space_unescape(variables[num_variables].name); rfc1738_unescape(variables[num_variables].name); #ifdef DEBUG_COMMENTS @@ -161,7 +177,9 @@ !variables[num_variables].value) continue; + plus_to_space_unescape(variables[num_variables].value); rfc1738_unescape(variables[num_variables].value); + plus_to_space_unescape(variables[num_variables].name); rfc1738_unescape(variables[num_variables].name); #ifdef DEBUG_COMMENTS