diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-10-22 10:19:17 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-10-22 10:19:17 +0000 |
commit | f0a51cfa098d25bf9af01523ff6a220e983fa717 (patch) | |
tree | 3c5bffa71b6d5dc60cdbc2ffb9f6306fc13d56d0 /src/core/ngx_string.c | |
parent | 070cf22ab45774b1f44d7eba5f6cd580998bd7b4 (diff) | |
download | nginx-f0a51cfa098d25bf9af01523ff6a220e983fa717.tar.gz nginx-f0a51cfa098d25bf9af01523ff6a220e983fa717.zip |
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 93b713d81..69f032e2e 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; |