1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00

MFH: Fixed bug #32937 (open_basedir looses trailing / in the limiter).

This commit is contained in:
Ilia Alshanetsky
2005-09-27 15:08:11 +00:00
parent d8507549de
commit 42dcaa63ea

View File

@@ -109,8 +109,8 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
/* Handler for basedirs that end with a / */
resolved_basedir_len = strlen(resolved_basedir);
if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) {
if (resolved_basedir[resolved_basedir_len - 1] == '/') {
resolved_basedir[resolved_basedir_len - 1] = PHP_DIR_SEPARATOR;
if (resolved_basedir[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) {
resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR;
resolved_basedir[++resolved_basedir_len] = '\0';
}
}