]> git.kaiwu.me - nginx.git/commitdiff
SSI bugfix: the "if" command did not work inside the "block" command and
authorValentin Bartenev <vbart@nginx.com>
Mon, 19 Dec 2011 13:28:22 +0000 (13:28 +0000)
committerValentin Bartenev <vbart@nginx.com>
Mon, 19 Dec 2011 13:28:22 +0000 (13:28 +0000)
produced parsing errors.

src/http/modules/ngx_http_ssi_filter_module.c

index 0b8bc9bf83a735ab6f1ed3820fe952d7b22a8884..a6209dc013a455c70f585ea850424dbe196a2fb9 100644 (file)
@@ -624,16 +624,6 @@ ngx_http_ssi_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
                     continue;
                 }
 
-                if (cmd->conditional
-                    && (ctx->conditional == 0
-                        || ctx->conditional > cmd->conditional))
-                {
-                    ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
-                                  "invalid context of SSI command: \"%V\"",
-                                  &ctx->command);
-                    goto ssi_error;
-                }
-
                 if (!ctx->output && !cmd->block) {
 
                     if (ctx->block) {
@@ -709,6 +699,16 @@ ngx_http_ssi_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
                     }
                 }
 
+                if (cmd->conditional
+                    && (ctx->conditional == 0
+                        || ctx->conditional > cmd->conditional))
+                {
+                    ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+                                  "invalid context of SSI command: \"%V\"",
+                                  &ctx->command);
+                    goto ssi_error;
+                }
+
                 if (ctx->params.nelts > NGX_HTTP_SSI_MAX_PARAMS) {
                     ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
                                   "too many SSI command paramters: \"%V\"",