@@ -1142,13 +1142,16 @@ static void init_request_info(TSRMLS_D)
1142
1142
TRANSLATE_SLASHES (env_document_root );
1143
1143
}
1144
1144
1145
- if (env_path_translated != NULL && env_redirect_url != NULL &&
1145
+ if (! apache_was_here && env_path_translated != NULL && env_redirect_url != NULL &&
1146
1146
env_path_translated != script_path_translated &&
1147
1147
strcmp (env_path_translated , script_path_translated ) != 0 ) {
1148
1148
/*
1149
1149
* pretty much apache specific. If we have a redirect_url
1150
1150
* then our script_filename and script_name point to the
1151
1151
* php executable
1152
+ * we don't want to do this for the new mod_proxy_fcgi approach,
1153
+ * where redirect_url may also exist but the below will break
1154
+ * with rewrites to PATH_INFO, hence the !apache_was_here check
1152
1155
*/
1153
1156
script_path_translated = env_path_translated ;
1154
1157
/* we correct SCRIPT_NAME now in case we don't have PATH_INFO */
@@ -1323,7 +1326,7 @@ static void init_request_info(TSRMLS_D)
1323
1326
efree (pt );
1324
1327
}
1325
1328
} else {
1326
- /* make sure path_info/translated are empty */
1329
+ /* make sure original values are remembered in ORIG_ copies if we've changed them */
1327
1330
if (!orig_script_filename ||
1328
1331
(script_path_translated != orig_script_filename &&
1329
1332
strcmp (script_path_translated , orig_script_filename ) != 0 )) {
@@ -1332,7 +1335,9 @@ static void init_request_info(TSRMLS_D)
1332
1335
}
1333
1336
script_path_translated = _sapi_cgibin_putenv ("SCRIPT_FILENAME" , script_path_translated TSRMLS_CC );
1334
1337
}
1335
- if (env_redirect_url ) {
1338
+ if (!apache_was_here && env_redirect_url ) {
1339
+ /* if we used PATH_TRANSLATED to work around Apache mod_fastcgi (but not mod_proxy_fcgi,
1340
+ * hence !apache_was_here) weirdness, strip info accordingly */
1336
1341
if (orig_path_info ) {
1337
1342
_sapi_cgibin_putenv ("ORIG_PATH_INFO" , orig_path_info TSRMLS_CC );
1338
1343
_sapi_cgibin_putenv ("PATH_INFO" , NULL TSRMLS_CC );
0 commit comments