Fix open_basedir behavior in url_stat
@@ -1246,7 +1246,11 @@ static php_stream *swow_php_plain_files_stream_opener(php_stream_wrapper *wrappe
static int swow_php_plain_files_url_stater(php_stream_wrapper *wrapper, const char *url, int flags, php_stream_statbuf *ssb, php_stream_context *context)
{
- if (!(flags & 4)) {
+ // note: PHP_STREAM_URL_STAT_NOCACHE is also 4 and will be passed here before 8.1
+#ifdef PHP_STREAM_URL_STAT_IGNORE_OPEN_BASEDIR
+ if (!(flags & PHP_STREAM_URL_STAT_IGNORE_OPEN_BASEDIR))
+#endif
+ {
if (strncasecmp(url, "file://", sizeof("file://") - 1) == 0) {
url += sizeof("file://") - 1;
}
