Skip to content

Commit bdba0cd

Browse files
committed
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`.
1 parent 85e241c commit bdba0cd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ PHP NEWS
44

55
- Core:
66
. Fixed bug #79566 (Private SHM is not private on Windows). (cmb)
7+
. Fixed bug #79489 (.user.ini does not inherit). (cmb)
78

89
- Opcache:
910
. Fixed bug #79535 (PHP crashes with specific opcache.optimization_level).

sapi/cgi/cgi_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,11 @@ static void php_cgi_ini_activate_user_config(char *path, size_t path_len, const
843843
if (strncmp(s1, s2, s_len) == 0) {
844844
#endif
845845
char *ptr = s2 + doc_root_len;
846+
#ifdef PHP_WIN32
847+
while ((ptr = strpbrk(ptr, "\\/")) != NULL) {
848+
#else
846849
while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
850+
#endif
847851
*ptr = 0;
848852
php_parse_user_ini_file(path, PG(user_ini_filename), entry->user_config);
849853
*ptr = '/';

0 commit comments

Comments
 (0)