From: Wez Furlong Date: Thu, 13 Feb 2003 17:32:41 +0000 (+0000) Subject: MFH: relative path fix for win32 X-Git-Tag: php-4.3.2RC1~226 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26d4841366f74450f05bf022d984ce39c9ce2768;p=php MFH: relative path fix for win32 --- diff --git a/main/streams.c b/main/streams.c index 484e8e4de8..b7385073f4 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1631,17 +1631,16 @@ PHPAPI php_stream *_php_stream_fopen_with_path(char *filename, char *mode, char filename_length = strlen(filename); /* Relative path open */ - if (*filename == '.' && (*(filename+1) == '/' || *(filename+1) == '.')) { + if (*filename == '.' && (IS_SLASH(filename[1]) || filename[1] == '.')) { /* further checks, we could have ....... filenames */ ptr = filename + 1; if (*ptr == '.') { while (*(++ptr) == '.'); - if (*ptr != '/') { /* not a relative path after all */ + if (!IS_SLASH(*ptr)) { /* not a relative path after all */ goto not_relative_path; } } - if (php_check_open_basedir(filename TSRMLS_CC)) { return NULL; }