Skip to content

Commit f62571c

Browse files
committed
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...
1 parent 94e09bf commit f62571c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sapi/fpm/fpm/fpm_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ static void sapi_cgi_log_message(char *message, int syslog_type_int)
627627

628628
/* {{{ php_cgi_ini_activate_user_config
629629
*/
630-
static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len, int start)
630+
static void php_cgi_ini_activate_user_config(char *path, int path_len, const char *doc_root, int doc_root_len)
631631
{
632632
char *ptr;
633633
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
677677
to find more user.ini, if not we only scan the current path.
678678
*/
679679
if (strncmp(s1, s2, s_len) == 0) {
680-
ptr = s2 + start; /* start is the point where doc_root ends! */
680+
ptr = s2 + doc_root_len;
681681
while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
682682
*ptr = 0;
683683
php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config);
@@ -751,7 +751,7 @@ static int sapi_cgi_activate(void) /* {{{ */
751751
--doc_root_len;
752752
}
753753

754-
php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1);
754+
php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len);
755755
}
756756
}
757757

0 commit comments

Comments
 (0)