Skip to content

Commit d73d44c

Browse files
committed
Revert "Merge branch 'pull-request/694' into PHP-5.6"
This reverts commit d96de86, reversing changes made to b1e32a4.
1 parent cd63740 commit d73d44c

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

sapi/fpm/fpm/fpm_main.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,19 @@ static void init_request_info(TSRMLS_D)
11481148
TRANSLATE_SLASHES(env_document_root);
11491149
}
11501150

1151+
if (env_path_translated != NULL && env_redirect_url != NULL &&
1152+
env_path_translated != script_path_translated &&
1153+
strcmp(env_path_translated, script_path_translated) != 0) {
1154+
/*
1155+
* pretty much apache specific. If we have a redirect_url
1156+
* then our script_filename and script_name point to the
1157+
* php executable
1158+
*/
1159+
script_path_translated = env_path_translated;
1160+
/* we correct SCRIPT_NAME now in case we don't have PATH_INFO */
1161+
env_script_name = env_redirect_url;
1162+
}
1163+
11511164
#ifdef __riscos__
11521165
/* Convert path to unix format*/
11531166
__riscosify_control |= __RISCOSIFY_DONT_CHECK_DIR;
@@ -1316,7 +1329,7 @@ static void init_request_info(TSRMLS_D)
13161329
efree(pt);
13171330
}
13181331
} else {
1319-
/* make sure original values are remembered in ORIG_ copies if we've changed them */
1332+
/* make sure path_info/translated are empty */
13201333
if (!orig_script_filename ||
13211334
(script_path_translated != orig_script_filename &&
13221335
strcmp(script_path_translated, orig_script_filename) != 0)) {
@@ -1325,6 +1338,16 @@ static void init_request_info(TSRMLS_D)
13251338
}
13261339
script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated TSRMLS_CC);
13271340
}
1341+
if (env_redirect_url) {
1342+
if (orig_path_info) {
1343+
_sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC);
1344+
_sapi_cgibin_putenv("PATH_INFO", NULL TSRMLS_CC);
1345+
}
1346+
if (orig_path_translated) {
1347+
_sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC);
1348+
_sapi_cgibin_putenv("PATH_TRANSLATED", NULL TSRMLS_CC);
1349+
}
1350+
}
13281351
if (env_script_name != orig_script_name) {
13291352
if (orig_script_name) {
13301353
_sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);

0 commit comments

Comments
 (0)