From 6d2e7a84caa611ff547b5da98d30b978933f751d Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 27 Sep 2005 15:07:38 +0000 Subject: [PATCH] Fixed bug #32937 (open_basedir looses trailing / in the limiter). Patch by Adam Conrad --- main/fopen_wrappers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index af28b8f758..ad9eecf790 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -108,8 +108,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'; } } -- 2.50.1