From 95388b7cdab48a167e06188467597d554489f686 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Tue, 18 Jan 2011 22:20:09 +0000 Subject: [PATCH] - fix regression introduced in 5.3.4 in open_basedir on windows/novell with trailing fwd slash --- main/fopen_wrappers.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index fe83092285..4ec3e5ee7a 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -228,7 +228,11 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path if (expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) != NULL) { /* Handler for basedirs that end with a / */ resolved_basedir_len = strlen(resolved_basedir); +#if defined(PHP_WIN32) || defined(NETWARE) + if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR || basedir[strlen(basedir) - 1] == '/') { +#else if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) { +#endif 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.40.0