[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/php_ini.c branches/PHP_5_3/sapi/cgi/cgi_main.c trunk/main/php_ini.c trunk/sapi/cgi/cgi_main.c
pajoye Thu, 15 Oct 2009 13:09:25 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289667 Log: - #48779, fix another use case where / usage may differ Bug: http://bugs.php.net/48779 (Open) Use of HOST section cause 500 error Changed paths: U php/php-src/branches/PHP_5_3/main/php_ini.c U php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c U php/php-src/trunk/main/php_ini.c U php/php-src/trunk/sapi/cgi/cgi_main.c Modified: php/php-src/branches/PHP_5_3/main/php_ini.c === --- php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-15 12:26:54 UTC (rev 289666) +++ php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-15 13:09:25 UTC (rev 289667) @@ -793,10 +793,18 @@ 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) { Modified: php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c === --- php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-15 12:26:54 UTC (rev 289666) +++ php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-15 13:09:25 UTC (rev 289667) @@ -818,10 +818,6 @@ 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 */ Modified: php/php-src/trunk/main/php_ini.c === --- php/php-src/trunk/main/php_ini.c2009-10-15 12:26:54 UTC (rev 289666) +++ php/php-src/trunk/main/php_ini.c2009-10-15 13:09:25 UTC (rev 289667) @@ -800,10 +800,18 @@ 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) { Modified: php/php-src/trunk/sapi/cgi/cgi_main.c === --- php/php-src/trunk/sapi/cgi/cgi_main.c 2009-10-15 12:26:54 UTC (rev 289666) +++ php/php-src/trunk/sapi/cgi/cgi_main.c 2009-10-15 13:09:25 UTC (rev 289667) @@ -815,10 +815,6 @@ 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 */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/php_ini.c branches/PHP_5_3/sapi/cgi/cgi_main.c trunk/main/php_ini.c trunk/sapi/cgi/cgi_main.c
pajoye Mon, 12 Oct 2009 14:40:27 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289568 Log: - #48779, improve fix, drop usage of _tolower and use zend_strtolower Bug: http://bugs.php.net/48779 (Open) Use of HOST section cause 500 error Changed paths: U php/php-src/branches/PHP_5_3/main/php_ini.c U php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c U php/php-src/trunk/main/php_ini.c U php/php-src/trunk/sapi/cgi/cgi_main.c Modified: php/php-src/branches/PHP_5_3/main/php_ini.c === --- php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-12 14:29:45 UTC (rev 289567) +++ php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-12 14:40:27 UTC (rev 289568) @@ -47,7 +47,7 @@ char *tmp = path; \ while (*tmp) { \ if (*tmp == '\\') *tmp = '/'; \ - else *tmp = (__isascii(*tmp)) ? _tolower(*tmp) : tolower(*tmp); \ + else *tmp = tolower(*tmp); \ tmp++; \ } \ } Modified: php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c === --- php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-12 14:29:45 UTC (rev 289567) +++ php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-12 14:40:27 UTC (rev 289568) @@ -820,7 +820,7 @@ path[path_len] = 0; #ifdef PHP_WIN32 /* paths on windows should be case-insensitive */ - strlwr(path); + zend_str_tolower(path, path_len); #endif /* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */ @@ -838,7 +838,7 @@ #ifdef PHP_WIN32 /* paths on windows should be case-insensitive */ doc_root = estrndup(doc_root, doc_root_len); - strlwr(doc_root); + zend_str_tolower(doc_root, doc_root_len); #endif php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1 TSRMLS_CC); } Modified: php/php-src/trunk/main/php_ini.c === --- php/php-src/trunk/main/php_ini.c2009-10-12 14:29:45 UTC (rev 289567) +++ php/php-src/trunk/main/php_ini.c2009-10-12 14:40:27 UTC (rev 289568) @@ -47,7 +47,7 @@ char *tmp = path; \ while (*tmp) { \ if (*tmp == '\\') *tmp = '/'; \ - else *tmp = (__isascii(*tmp)) ? _tolower(*tmp) : tolower(*tmp); \ + else *tmp = tolower(*tmp); \ tmp++; \ } \ } Modified: php/php-src/trunk/sapi/cgi/cgi_main.c === --- php/php-src/trunk/sapi/cgi/cgi_main.c 2009-10-12 14:29:45 UTC (rev 289567) +++ php/php-src/trunk/sapi/cgi/cgi_main.c 2009-10-12 14:40:27 UTC (rev 289568) @@ -817,7 +817,7 @@ path[path_len] = 0; #ifdef PHP_WIN32 /* paths on windows should be case-insensitive */ - strlwr(path); + zend_str_tolower(path, path_len); #endif /* Activate per-dir-system-configuration defined in php.ini and stored into configuration_hash during startup */ @@ -835,7 +835,7 @@ #ifdef PHP_WIN32 /* paths on windows should be case-insensitive */ doc_root = estrndup(doc_root, doc_root_len); - strlwr(doc_root); + zend_str_tolower(doc_root, doc_root_len); #endif php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1 TSRMLS_CC); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/php_ini.c branches/PHP_5_3/sapi/cgi/cgi_main.c trunk/main/php_ini.c trunk/sapi/cgi/cgi_main.c
felipe Fri, 09 Oct 2009 20:01:16 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289446 Log: - Fixed build and comment-style Changed paths: U php/php-src/branches/PHP_5_3/main/php_ini.c U php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c U php/php-src/trunk/main/php_ini.c U php/php-src/trunk/sapi/cgi/cgi_main.c Modified: php/php-src/branches/PHP_5_3/main/php_ini.c === --- php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 19:43:00 UTC (rev 289445) +++ php/php-src/branches/PHP_5_3/main/php_ini.c 2009-10-09 20:01:16 UTC (rev 289446) @@ -288,7 +288,7 @@ is_special_section = 1; has_per_dir_config = 1; #ifdef PHP_WIN32 - // make the path lowercase on Windows, for case insensitivty. + /* make the path lowercase on Windows, for case insensitivty. */ strlwr(key); TRANSLATE_SLASHES(key); @@ -301,7 +301,7 @@ key_len = Z_STRLEN_P(arg1) - sizeof(HOST) + 1; is_special_section = 1; has_per_host_config = 1; - strlwr(key); // host names are case-insensitive. + zend_str_tolower(key, key_len); /* host names are case-insensitive. */ } else { is_special_section = 0; Modified: php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c === --- php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-09 19:43:00 UTC (rev 289445) +++ php/php-src/branches/PHP_5_3/sapi/cgi/cgi_main.c2009-10-09 20:01:16 UTC (rev 289446) @@ -794,8 +794,8 @@ /* SERVER_NAME should also be defined at this stage..but better check it anyway */ if (server_name) { server_name_len = strlen(server_name); - server_name = estrndup(server_name, strlen(server_name) ); - strlwr(server_name); + server_name = estrndup(server_name, server_name_len); + zend_str_tolower(server_name, server_name_len); php_ini_activate_per_host_config(server_name, server_name_len + 1 TSRMLS_CC); efree(server_name); } @@ -819,7 +819,7 @@ } path[path_len] = 0; #ifdef PHP_WIN32 - // paths on windows should be case-insensitive + /* paths on windows should be case-insensitive */ strlwr(path); #endif @@ -836,7 +836,7 @@ --doc_root_len; } #ifdef PHP_WIN32 - // paths on windows should be case-insensitive + /* paths on windows should be case-insensitive */ doc_root = estrndup(doc_root, doc_root_len); strlwr(doc_root); #endif Modified: php/php-src/trunk/main/php_ini.c === --- php/php-src/trunk/main/php_ini.c2009-10-09 19:43:00 UTC (rev 289445) +++ php/php-src/trunk/main/php_ini.c2009-10-09 20:01:16 UTC (rev 289446) @@ -288,7 +288,7 @@ is_special_section = 1; has_per_dir_config = 1; #ifdef PHP_WIN32 - // make the path lowercase on Windows, for case insensitivty. + /* make the path lowercase on Windows, for case insensitivty. */ strlwr(key); TRANSLATE_SLASHES(key); @@ -301,7 +301,7 @@ key_len = Z_STRLEN_P(arg1) - sizeof(HOST) + 1; is_special_section = 1; has_per_host_config = 1; - strlwr(key); // host names are case-insensitive. + zend_str_tolower(key, key_len); /* host names are case-insensitive. */ } else { is_special_section = 0; Modified: php/php-src/trunk/sapi/cgi/cgi_main.c === --- php/php-src/trunk/sapi/cgi/cgi_main.c 2009-10-09 19:43:00 UTC (rev 289445) +++ php/php-src/trunk/sapi/cgi/cgi_main.c 2009-10-09 20:01:16 UTC (rev 289446) @@ -791,8 +791,8 @@