diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2007-12-12 20:56:13 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2007-12-12 20:56:13 +0000 |
| commit | c9115e73d5663dcaf9f8c4302c14a2dea51cd667 (patch) | |
| tree | 2fed39d46b25cf49c218bf029360b0c62ef9ca6f /src/core/ngx_string.c | |
| parent | d66b7a8a1ae71d0c4e2d767f4d06f05890169b56 (diff) | |
| download | nginx-c9115e73d5663dcaf9f8c4302c14a2dea51cd667.tar.gz nginx-c9115e73d5663dcaf9f8c4302c14a2dea51cd667.tar.bz2 | |
r1594 merge:
unescape SSI include
Diffstat (limited to 'src/core/ngx_string.c')
| -rw-r--r-- | src/core/ngx_string.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c index 0385c9643..ad70fb3c9 100644 --- a/src/core/ngx_string.c +++ b/src/core/ngx_string.c @@ -1243,7 +1243,9 @@ ngx_unescape_uri(u_char **dst, u_char **src, size_t size, ngx_uint_t type) switch (state) { case sw_usual: - if (ch == '?' && type == NGX_UNESCAPE_URI) { + if (ch == '?' + && (type & (NGX_UNESCAPE_URI|NGX_UNESCAPE_REDIRECT))) + { *d++ = ch; goto done; } @@ -1286,7 +1288,7 @@ ngx_unescape_uri(u_char **dst, u_char **src, size_t size, ngx_uint_t type) if (ch >= '0' && ch <= '9') { ch = (u_char) ((decoded << 4) + ch - '0'); - if (type == NGX_UNESCAPE_URI) { + if (type & NGX_UNESCAPE_REDIRECT) { if (ch > '%' && ch < 0x7f) { *d++ = ch; break; @@ -1306,7 +1308,17 @@ ngx_unescape_uri(u_char **dst, u_char **src, size_t size, ngx_uint_t type) if (c >= 'a' && c <= 'f') { ch = (u_char) ((decoded << 4) + c - 'a' + 10); - if (type == NGX_UNESCAPE_URI) { + if (type & NGX_UNESCAPE_URI) { + if (ch == '?') { + *d++ = ch; + goto done; + } + + *d++ = ch; + break; + } + + if (type & NGX_UNESCAPE_REDIRECT) { if (ch == '?') { *d++ = ch; goto done; |
