freebsd-ports/www/mod_encoding/files/queryfix-patch22
Philip M. Gollucci dc8d638afb - fix build with www/apache22
- fix build with www/apache20

PR:             ports/127032
Submitted by:   Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
2008-12-28 08:08:59 +00:00

30 lines
1 KiB
Text

diff -urN mod_encoding.c.orig mod_encoding.c
--- mod_encoding.c.orig Tue Jun 11 18:07:14 2002
+++ mod_encoding.c Fri Dec 13 11:43:46 2002
@@ -129,13 +129,21 @@
char *buff;
char *keys[] = { "Destination", NULL };
int i;
+ char *unparsed_uri;
+ char *query_string;
/* Normalize encoding in HTTP request line */
- ap_unescape_url(r->unparsed_uri);
- if ((buff = iconv_string(r, cd, r->unparsed_uri,
- strlen(r->unparsed_uri))) == NULL)
+ query_string = apr_pstrdup(r->pool, r->unparsed_uri);
+ unparsed_uri = ap_getword(r->pool, &query_string, '?');
+ ap_unescape_url(unparsed_uri);
+ if ((buff = iconv_string(r, cd, unparsed_uri,
+ strlen(unparsed_uri))) == NULL)
return -1;
- ap_parse_uri(r, buff);
+ if (query_string && strlen(query_string) > 0) {
+ ap_parse_uri(r, apr_pstrcat(r->pool, buff, "?", query_string, NULL));
+ } else {
+ ap_parse_uri(r, buff);
+ }
ap_getparents(r->uri); /* normalize given path for security */
/* Normalize encoding in HTTP request header(s) */