comparison src/http/modules/ngx_http_log_module.c @ 4240:17ab1927f80f stable-1.0

Merging r3992, r4192: access_log related fixes: *) Removal of error message about %name log_format parameters, they have been deleted long ago in 0.5.0-RELEASE. *) Improved access log escaping to better protect other software. Some character sets (notably ISO-8859-1) have C1 control characters in upper half, make sure to escape them.
author Igor Sysoev <igor@sysoev.ru>
date Tue, 01 Nov 2011 11:06:31 +0000
parents eae4a59ae59a
children d3568507db51
comparison
equal deleted inserted replaced
4239:033e906f4358 4240:17ab1927f80f
688 688
689 /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */ 689 /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */
690 0x10000000, /* 0001 0000 0000 0000 0000 0000 0000 0000 */ 690 0x10000000, /* 0001 0000 0000 0000 0000 0000 0000 0000 */
691 691
692 /* ~}| {zyx wvut srqp onml kjih gfed cba` */ 692 /* ~}| {zyx wvut srqp onml kjih gfed cba` */
693 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ 693 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */
694 694
695 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ 695 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
696 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ 696 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
697 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ 697 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
698 0x00000000, /* 0000 0000 0000 0000 0000 0000 0000 0000 */ 698 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
699 }; 699 };
700 700
701 701
702 if (dst == NULL) { 702 if (dst == NULL) {
703 703
1053 1053
1054 value = args->elts; 1054 value = args->elts;
1055 1055
1056 for ( /* void */ ; s < args->nelts; s++) { 1056 for ( /* void */ ; s < args->nelts; s++) {
1057 1057
1058 for (i = 0; i < value[s].len; i++) {
1059 if (value[s].data[i] != '%') {
1060 continue;
1061 }
1062
1063 ch = value[s].data[i + 1];
1064
1065 if ((ch >= 'A' && ch <= 'Z')
1066 || (ch >= 'a' && ch <= 'z')
1067 || ch == '{')
1068 {
1069 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1070 "the parameters in the \"%%name\" form are not supported, "
1071 "use the \"$variable\" instead");
1072
1073 return NGX_CONF_ERROR;
1074 }
1075 }
1076
1077 i = 0; 1058 i = 0;
1078 1059
1079 while (i < value[s].len) { 1060 while (i < value[s].len) {
1080 1061
1081 op = ngx_array_push(ops); 1062 op = ngx_array_push(ops);