diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 61088c465be..28ed0be9948 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1098,7 +1098,7 @@ static void init_request_info(TSRMLS_D) #define APACHE_PROXY_FCGI_PREFIX "proxy:fcgi://" /* Fix proxy URLs in SCRIPT_FILENAME generated by Apache mod_proxy_fcgi: - * proxy:fcgi://localhost:9000/some-dir/info.php/test + * proxy:fcgi://localhost:9000/some-dir/info.php/test?foo=bar * should be changed to: * /some-dir/info.php/test * See: http://bugs.php.net/bug.php?id=54152 @@ -1118,6 +1118,11 @@ static void init_request_info(TSRMLS_D) memmove(env_script_filename, p, strlen(p) + 1); apache_was_here = 1; } + /* ignore query string if sent by Apache (RewriteRule) */ + p = strchr(env_script_filename, '?'); + if (p) { + *p =0; + } } if (CGIG(fix_pathinfo)) {