summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-04-20 10:46:20 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-04-20 10:47:54 +0200
commitf62571c121ce2874858b5e7dd33642755ee9309c (patch)
treef9117dddcf1651360dad0b7ac221716b209c8ac3
parent94e09bfe558656d3f1470dc960b900a951b0dffc (diff)
downloadphp-git-f62571c121ce2874858b5e7dd33642755ee9309c.tar.gz
Apply doc root fix for FPM
This is the change from GH-5417 but for FPM. This was stripping the last character from the doc_root. Given how it is used, this should be harmless, but let's make it less confusing...
-rw-r--r--sapi/fpm/fpm/fpm_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 65890f9fdf..85d83593f3 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -627,7 +627,7 @@ static void sapi_cgi_log_message(char *message, int syslog_type_int)
/* {{{ php_cgi_ini_activate_user_config
*/
-static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len, int start)
+static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len)
{
char *ptr;
time_t request_time = sapi_get_request_time();
@@ -677,7 +677,7 @@ static void php_cgi_ini_activate_user_config(char *path, int path_len, const cha
to find more user.ini, if not we only scan the current path.
*/
if (strncmp(s1, s2, s_len) == 0) {
- ptr = s2 + start; /* start is the point where doc_root ends! */
+ ptr = s2 + doc_root_len;
while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
*ptr = 0;
php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config);
@@ -751,7 +751,7 @@ static int sapi_cgi_activate(void) /* {{{ */
--doc_root_len;
}
- php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1);
+ php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len);
}
}