summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2011-01-18 22:20:09 +0000
committerPierre Joye <pajoye@php.net>2011-01-18 22:20:09 +0000
commit95388b7cdab48a167e06188467597d554489f686 (patch)
treef2bc8ecb08b5dd8ea1e772b2e8bf862661bb3f42
parentf455f85e6cbfe3792beaa0f1262d56628ee01554 (diff)
downloadphp-git-95388b7cdab48a167e06188467597d554489f686.tar.gz
- fix regression introduced in 5.3.4 in open_basedir on windows/novell with trailing fwd slash
-rw-r--r--main/fopen_wrappers.c4
1 files changed, 4 insertions, 0 deletions
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';