/[apache]/trunk/dist/2.2/patches/02_all_mod_rewrite_ampescape.patch
Gentoo

Diff of /trunk/dist/2.2/patches/02_all_mod_rewrite_ampescape.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 68 Revision 69
1Provide escaping for the ampersand in mod_rewrite
1diff -ru httpd-2.0.52/modules/mappers/mod_rewrite.c httpd-2.0.52.ampescape/modules/mappers/mod_rewrite.c 2diff -ur httpd-2.2.0/modules/mappers/mod_rewrite.c httpd-2.2.0.patched/modules/mappers/mod_rewrite.c
2--- httpd-2.0.52/modules/mappers/mod_rewrite.c 2004-08-27 21:23:26.000000000 +0200 3--- httpd-2.2.0/modules/mappers/mod_rewrite.c 2005-11-10 07:20:05.000000000 -0800
3+++ httpd-2.0.52.ampescape/modules/mappers/mod_rewrite.c 2004-11-19 19:04:17.190398544 +0100 4+++ httpd-2.2.0.patched/modules/mappers/mod_rewrite.c 2006-02-04 13:52:34.000000000 -0800
4@@ -964,6 +964,7 @@ 5@@ -1075,6 +1075,30 @@
5 map_pfn_register("tolower", rewrite_mapfunc_tolower); 6 return ap_escape_uri(r->pool, key);
6 map_pfn_register("toupper", rewrite_mapfunc_toupper);
7 map_pfn_register("escape", rewrite_mapfunc_escape);
8+ map_pfn_register("ampescape", rewrite_mapfunc_ampescape);
9 map_pfn_register("unescape", rewrite_mapfunc_unescape);
10 }
11 return OK;
12@@ -3346,6 +3347,29 @@
13 return value;
14 } 7 }
15 8
16+static char *rewrite_mapfunc_ampescape(request_rec *r, char *key) { 9+static char *rewrite_mapfunc_ampescape(request_rec *r, char *key) {
17+ /* we only need to escape the ampersand */ 10+ /* we only need to escape the ampersand */
18+ 11+
34+ *d = '\0'; 27+ *d = '\0';
35+ 28+
36+ return copy; 29+ return copy;
37+} 30+}
38+ 31+
32+
39 static char *rewrite_mapfunc_unescape(request_rec *r, char *key) 33 static char *rewrite_mapfunc_unescape(request_rec *r, char *key)
40 { 34 {
41 char *value; 35 ap_unescape_url(key);
42diff -ru httpd-2.0.52/modules/mappers/mod_rewrite.h httpd-2.0.52.ampescape/modules/mappers/mod_rewrite.h 36@@ -4011,6 +4035,7 @@
43--- httpd-2.0.52/modules/mappers/mod_rewrite.h 2004-08-20 23:17:41.000000000 +0200 37 map_pfn_register("tolower", rewrite_mapfunc_tolower);
44+++ httpd-2.0.52.ampescape/modules/mappers/mod_rewrite.h 2004-11-19 18:29:50.000000000 +0100 38 map_pfn_register("toupper", rewrite_mapfunc_toupper);
45@@ -389,6 +389,7 @@ 39 map_pfn_register("escape", rewrite_mapfunc_escape);
46 static char *rewrite_mapfunc_toupper(request_rec *r, char *key); 40+ map_pfn_register("ampescape", rewrite_mapfunc_ampescape);
47 static char *rewrite_mapfunc_tolower(request_rec *r, char *key); 41 map_pfn_register("unescape", rewrite_mapfunc_unescape);
48 static char *rewrite_mapfunc_escape(request_rec *r, char *key); 42 }
49+static char *rewrite_mapfunc_ampescape(request_rec *r, char *key); 43 return OK;
50 static char *rewrite_mapfunc_unescape(request_rec *r, char *key);
51
52 static char *select_random_value_part(request_rec *r, char *value);

Legend:
Removed from v.68  
changed lines
  Added in v.69

  ViewVC Help
Powered by ViewVC 1.1.20