diff options
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r-- | main/streams/plain_wrapper.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index e3eda978d8..58b5b64e0e 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -351,7 +351,7 @@ static ssize_t php_stdiop_write(php_stream *stream, const char *buf, size_t coun ssize_t bytes_written = write(data->fd, buf, count); #endif if (bytes_written < 0) { - if (errno == EWOULDBLOCK || errno == EAGAIN) { + if (PHP_IS_TRANSIENT_ERROR(errno)) { return 0; } if (errno == EINTR) { @@ -422,7 +422,7 @@ static ssize_t php_stdiop_read(php_stream *stream, char *buf, size_t count) } if (ret < 0) { - if (errno == EWOULDBLOCK || errno == EAGAIN) { + if (PHP_IS_TRANSIENT_ERROR(errno)) { /* Not an error. */ ret = 0; } else if (errno == EINTR) { @@ -1157,12 +1157,14 @@ static php_stream *php_plain_files_stream_opener(php_stream_wrapper *wrapper, co static int php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context) { - if (strncasecmp(url, "file://", sizeof("file://") - 1) == 0) { - url += sizeof("file://") - 1; - } + if (!(flags & PHP_STREAM_URL_STAT_IGNORE_OPEN_BASEDIR)) { + if (strncasecmp(url, "file://", sizeof("file://") - 1) == 0) { + url += sizeof("file://") - 1; + } - if (php_check_open_basedir_ex(url, (flags & PHP_STREAM_URL_STAT_QUIET) ? 0 : 1)) { - return -1; + if (php_check_open_basedir_ex(url, (flags & PHP_STREAM_URL_STAT_QUIET) ? 0 : 1)) { + return -1; + } } #ifdef PHP_WIN32 |