summaryrefslogtreecommitdiff
path: root/ext/standard/dir.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-08-21 00:42:44 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-09-07 18:58:11 +0200
commit2c96780e1c10c3c851608835411e21879a069199 (patch)
tree56d8f9168d9ad60a89cad1598e0498230a1d4e1e /ext/standard/dir.c
parenta249980006477ee48b44fa26a3b3d48c4c24633c (diff)
downloadphp-git-2c96780e1c10c3c851608835411e21879a069199.tar.gz
Fix UNKNOWN default values in ext/standard
Closes GH-6026
Diffstat (limited to 'ext/standard/dir.c')
-rw-r--r--ext/standard/dir.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index e480c245fe..98bff12fc2 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -61,9 +61,9 @@ static zend_class_entry *dir_class_entry_ptr;
#define FETCH_DIRP() \
ZEND_PARSE_PARAMETERS_START(0, 1) \
Z_PARAM_OPTIONAL \
- Z_PARAM_RESOURCE(id) \
+ Z_PARAM_RESOURCE_OR_NULL(id) \
ZEND_PARSE_PARAMETERS_END(); \
- if (ZEND_NUM_ARGS() == 0) { \
+ if (!id) { \
myself = getThis(); \
if (myself) { \
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(myself), "handle", sizeof("handle")-1)) == NULL) { \
@@ -201,7 +201,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_PATH(dirname, dir_len)
Z_PARAM_OPTIONAL
- Z_PARAM_RESOURCE(zcontext)
+ Z_PARAM_RESOURCE_OR_NULL(zcontext)
ZEND_PARSE_PARAMETERS_END();
context = php_stream_context_from_zval(zcontext, 0);
@@ -538,7 +538,7 @@ PHP_FUNCTION(scandir)
Z_PARAM_PATH(dirn, dirn_len)
Z_PARAM_OPTIONAL
Z_PARAM_LONG(flags)
- Z_PARAM_RESOURCE(zcontext)
+ Z_PARAM_RESOURCE_OR_NULL(zcontext)
ZEND_PARSE_PARAMETERS_END();
if (dirn_len < 1) {