]> git.kaiwu.me - nginx.git/commitdiff
test zero value in an "if" directive consistently with predicates fixed in r3894
authorIgor Sysoev <igor@sysoev.ru>
Tue, 3 May 2011 09:52:27 +0000 (09:52 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 3 May 2011 09:52:27 +0000 (09:52 +0000)
thanks to Maxim Dounin

src/http/ngx_http_script.c

index 7c8de1445edb748e43a88c1cf091c2b2aa9d7934..a703f0837898bb23c22aa3874ebfe1d009187948 100644 (file)
@@ -1395,7 +1395,7 @@ ngx_http_script_if_code(ngx_http_script_engine_t *e)
 
     e->sp--;
 
-    if (e->sp->len && e->sp->data[0] != '0') {
+    if (e->sp->len && (e->sp->len !=1 || e->sp->data[0] != '0')) {
         if (code->loc_conf) {
             e->request->loc_conf = code->loc_conf;
             ngx_http_update_location_config(e->request);