]> git.kaiwu.me - nginx.git/commitdiff
Pass PCRE_CASELESS to pcre_compile() for caseless matching.
authorRuslan Ermilov <ru@nginx.com>
Fri, 29 Mar 2013 08:47:37 +0000 (08:47 +0000)
committerRuslan Ermilov <ru@nginx.com>
Fri, 29 Mar 2013 08:47:37 +0000 (08:47 +0000)
Previously, we sometimes passed constant value 1 that happens to
match PCRE_CASELESS and thus was harmless.

src/http/ngx_http_core_module.c

index 80cf2d6b95191fcba44461800826534e401d6237..25d3dc97de375282fcb3487c158a31d2278503d0 100644 (file)
@@ -3256,7 +3256,7 @@ ngx_http_core_regex_location(ngx_conf_t *cf, ngx_http_core_loc_conf_t *clcf,
 #if (NGX_HAVE_CASELESS_FILESYSTEM)
     rc.options = NGX_REGEX_CASELESS;
 #else
-    rc.options = caseless;
+    rc.options = caseless ? NGX_REGEX_CASELESS : 0;
 #endif
 
     clcf->regex = ngx_http_regex_compile(cf, &rc);