mirror of
https://github.com/php/php-src.git
synced 2025-01-11 05:24:49 +08:00
Fixed bug #40419 (Trailing Slash in CGI request don't work)
This commit is contained in:
parent
c031c5461c
commit
a5a98e6322
@ -738,9 +738,9 @@ static void init_request_info(TSRMLS_D)
|
||||
char *env_path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO")-1 TSRMLS_CC);
|
||||
char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME", sizeof("SCRIPT_NAME")-1 TSRMLS_CC);
|
||||
|
||||
if (CGIG(fix_pathinfo)) {
|
||||
if (CGIG(fix_pathinfo)) {
|
||||
struct stat st;
|
||||
char *real_path;
|
||||
char *real_path = NULL;
|
||||
char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL", sizeof("REDIRECT_URL")-1 TSRMLS_CC);
|
||||
char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC);
|
||||
char *orig_path_translated = env_path_translated;
|
||||
@ -902,6 +902,9 @@ static void init_request_info(TSRMLS_D)
|
||||
efree(pt);
|
||||
}
|
||||
} else {
|
||||
if (real_path) {
|
||||
script_path_translated = real_path;
|
||||
}
|
||||
/* make sure path_info/translated are empty */
|
||||
if (!orig_script_filename ||
|
||||
(script_path_translated != orig_script_filename) ||
|
||||
@ -927,8 +930,10 @@ static void init_request_info(TSRMLS_D)
|
||||
} else {
|
||||
SG(request_info).request_uri = env_script_name;
|
||||
}
|
||||
if (real_path) {
|
||||
free(real_path);
|
||||
}
|
||||
}
|
||||
free(real_path);
|
||||
} else {
|
||||
/* pre 4.3 behaviour, shouldn't be used but provides BC */
|
||||
if (env_path_info) {
|
||||
|
Loading…
Reference in New Issue
Block a user