Revert "Merge branch 'pull-request/694' into PHP-5.6"

This reverts commit d96de86b5b, reversing
changes made to b1e32a4f7a.
This commit is contained in:
David Zuelke 2014-08-09 08:14:23 +02:00
parent cd63740db7
commit d73d44c237

View file

@ -1148,6 +1148,19 @@ static void init_request_info(TSRMLS_D)
TRANSLATE_SLASHES(env_document_root);
}
if (env_path_translated != NULL && env_redirect_url != NULL &&
env_path_translated != script_path_translated &&
strcmp(env_path_translated, script_path_translated) != 0) {
/*
* pretty much apache specific. If we have a redirect_url
* then our script_filename and script_name point to the
* php executable
*/
script_path_translated = env_path_translated;
/* we correct SCRIPT_NAME now in case we don't have PATH_INFO */
env_script_name = env_redirect_url;
}
#ifdef __riscos__
/* Convert path to unix format*/
__riscosify_control |= __RISCOSIFY_DONT_CHECK_DIR;
@ -1316,7 +1329,7 @@ static void init_request_info(TSRMLS_D)
efree(pt);
}
} else {
/* make sure original values are remembered in ORIG_ copies if we've changed them */
/* make sure path_info/translated are empty */
if (!orig_script_filename ||
(script_path_translated != orig_script_filename &&
strcmp(script_path_translated, orig_script_filename) != 0)) {
@ -1325,6 +1338,16 @@ static void init_request_info(TSRMLS_D)
}
script_path_translated = _sapi_cgibin_putenv("SCRIPT_FILENAME", script_path_translated TSRMLS_CC);
}
if (env_redirect_url) {
if (orig_path_info) {
_sapi_cgibin_putenv("ORIG_PATH_INFO", orig_path_info TSRMLS_CC);
_sapi_cgibin_putenv("PATH_INFO", NULL TSRMLS_CC);
}
if (orig_path_translated) {
_sapi_cgibin_putenv("ORIG_PATH_TRANSLATED", orig_path_translated TSRMLS_CC);
_sapi_cgibin_putenv("PATH_TRANSLATED", NULL TSRMLS_CC);
}
}
if (env_script_name != orig_script_name) {
if (orig_script_name) {
_sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);