aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-04-21 14:58:21 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-04-21 14:58:21 +0000
commitece10ddcf5a56808e860560411d4590bd07feb04 (patch)
treeb8a93f8efda7696f87a1fdff67a6247ae49e4bc0 /src
parent6b55b4b5203d91c1eb3529c71299033b8c7dae40 (diff)
downloadnginx-ece10ddcf5a56808e860560411d4590bd07feb04.tar.gz
nginx-ece10ddcf5a56808e860560411d4590bd07feb04.zip
do not store an encoded variable value as a new cached variable value
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_ssi_filter_module.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c
index 6dcce3f31..3f3899ae9 100644
--- a/src/http/modules/ngx_http_ssi_filter_module.c
+++ b/src/http/modules/ngx_http_ssi_filter_module.c
@@ -2161,10 +2161,9 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
}
}
- switch (ctx->encoding) {
+ p = value->data;
- case NGX_HTTP_SSI_NO_ENCODING:
- break;
+ switch (ctx->encoding) {
case NGX_HTTP_SSI_URL_ENCODING:
len = 2 * ngx_escape_uri(NULL, value->data, value->len,
@@ -2177,11 +2176,9 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
}
(void) ngx_escape_uri(p, value->data, value->len, NGX_ESCAPE_HTML);
-
- value->len += len;
- value->data = p;
}
+ len += value->len;
break;
case NGX_HTTP_SSI_ENTITY_ENCODING:
@@ -2194,11 +2191,13 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
}
(void) ngx_escape_html(p, value->data, value->len);
-
- value->len += len;
- value->data = p;
}
+ len += value->len;
+ break;
+
+ default: /* NGX_HTTP_SSI_NO_ENCODING */
+ len = value->len;
break;
}
@@ -2213,8 +2212,8 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
}
b->memory = 1;
- b->pos = value->data;
- b->last = value->data + value->len;
+ b->pos = p;
+ b->last = p + len;
cl->buf = b;
cl->next = NULL;