Permalink
Browse files

- #48779, fix another use case where / usage may differ

  • Loading branch information...
1 parent ef17315 commit e4adfe4f61cb54c4da6e8144f82d6f6cc9d6e797 @pierrejoye pierrejoye committed Oct 15, 2009
Showing with 9 additions and 5 deletions.
  1. +9 −1 main/php_ini.c
  2. +0 −4 sapi/cgi/cgi_main.c
View
@@ -793,10 +793,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) {
View
@@ -818,10 +818,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 */

0 comments on commit e4adfe4

Please sign in to comment.