summaryrefslogtreecommitdiff
path: root/main/streams/plain_wrapper.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2021-02-26 02:28:46 +0300
committerDmitry Stogov <dmitry@zend.com>2021-02-26 02:28:46 +0300
commit13e4ce386bb7257dbbe3167b070382ea959ec763 (patch)
treebf73295d32470a3e85d84dc244655f37c550c386 /main/streams/plain_wrapper.c
parent5e8ae15c3d59f5ee4ca9f51b4ee712e2ada67864 (diff)
downloadphp-git-13e4ce386bb7257dbbe3167b070382ea959ec763.tar.gz
Improve SPL directory and stat() cache using zend_srting* instead of char*
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r--main/streams/plain_wrapper.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index a63c225a0d..58b5b64e0e 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -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