From: Pierre Joye Date: Thu, 15 Oct 2009 13:09:25 +0000 (+0000) Subject: - #48779, fix another use case where / usage may differ X-Git-Tag: php-5.4.0alpha1~191^2~2508 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4706ebbfe250e3e85e5043e5e748b5814553dda4;p=php - #48779, fix another use case where / usage may differ --- diff --git a/main/php_ini.c b/main/php_ini.c index 8f43f045ab..d07a198aaf 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -800,10 +800,18 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len TSRMLS_DC) zval *tmp; char *ptr; +#if PHP_WIN32 + char path_bak[MAXPATHLEN]; + memcpy(path_bak, path, path_len); + path_bak[path_len] = 0; + TRANSLATE_SLASHES_LOWER(path_bak); + path = path_bak; +#endif + /* Walk through each directory in path and apply any found per-dir-system-configuration from configuration_hash */ if (has_per_dir_config && path && path_len) { ptr = path + 1; - while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) { + while ((ptr = strchr(ptr, '/')) != NULL) { *ptr = 0; /* Search for source array matching the path from configuration_hash */ if (zend_hash_find(&configuration_hash, path, path_len, (void **) &tmp) == SUCCESS) { diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 38f63410b9..f71f2606d3 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -815,10 +815,6 @@ static int sapi_cgi_activate(TSRMLS_D) path_len = zend_dirname(path, path_len); } path[path_len] = 0; -#ifdef PHP_WIN32 - /* paths on windows should be case-insensitive */ - zend_str_tolower(path, path_len); -#endif /* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */ php_ini_activate_per_dir_config(path, path_len TSRMLS_CC); /* Note: for global settings sake we check from root to path */