- fix regression introduced in 5.3.4 in open_basedir on windows/novell with trailing fwd slash

This commit is contained in:
Pierre Joye 2011-01-18 22:20:09 +00:00
parent 8cdcdb1b1e
commit e3c920ecf3

View file

@ -229,7 +229,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';