summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-05-05 10:36:16 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-05-12 11:47:47 +0200
commitbdba0cd3d270d5c0511709e3b8e2e0cd6186a410 (patch)
treea7d4b6639846d37f2641595bdff5ed012cbe8a42 /sapi/cgi/cgi_main.c
parent85e241c35c3d4cb1cc027ecca2572e1ff04e3d06 (diff)
downloadphp-git-bdba0cd3d270d5c0511709e3b8e2e0cd6186a410.tar.gz
Fix #79489: .user.ini does not inherit
On Windows, PATH_TRANSLATED may contain backslashes as well as slashes, so we must not only check for `DEFAULT_SLASH`.
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 8c8e1463d5..37f8eac6e0 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -843,7 +843,11 @@ static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const
if (strncmp(s1, s2, s_len) == 0) {
#endif
char *ptr = s2 + doc_root_len;
+#ifdef PHP_WIN32
+ while ((ptr = strpbrk(ptr, "\\/")) != NULL) {
+#else
while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
+#endif
*ptr = 0;
php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config);
*ptr = '/';