]> granicus.if.org Git - php/commitdiff
- #48779, fix another use case where / usage may differ
authorPierre Joye <pajoye@php.net>
Thu, 15 Oct 2009 13:09:25 +0000 (13:09 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 15 Oct 2009 13:09:25 +0000 (13:09 +0000)
main/php_ini.c
sapi/cgi/cgi_main.c

index 8f43f045ab327b8e4bd8032265ba58acc8e25b7e..d07a198aaf65378bab37f3467e039353b9986644 100644 (file)
@@ -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) {
index 38f63410b984650d12f731b1fe4039611c7bce73..f71f2606d3387bdf6880896702d9e04bf6b836f7 100644 (file)
@@ -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 */