Skip to content

Commit d61bd51

Browse files
committed
Use a proper empty array default value for imap_open()
1 parent b63564c commit d61bd51

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ext/imap/php_imap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,10 +702,10 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
702702
zend_long retries = 0, flags = NIL, cl_flags = NIL;
703703
MAILSTREAM *imap_stream;
704704
pils *imap_le_struct;
705-
zval *params = NULL;
705+
HashTable *params = NULL;
706706
int argc = ZEND_NUM_ARGS();
707707

708-
if (zend_parse_parameters(argc, "PSS|lla", &mailbox, &user,
708+
if (zend_parse_parameters(argc, "PSS|llh", &mailbox, &user,
709709
&passwd, &flags, &retries, &params) == FAILURE) {
710710
RETURN_THROWS();
711711
}
@@ -723,7 +723,7 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
723723
if (params) {
724724
zval *disabled_auth_method;
725725

726-
if ((disabled_auth_method = zend_hash_str_find(Z_ARRVAL_P(params), "DISABLE_AUTHENTICATOR", sizeof("DISABLE_AUTHENTICATOR") - 1)) != NULL) {
726+
if ((disabled_auth_method = zend_hash_str_find(params, "DISABLE_AUTHENTICATOR", sizeof("DISABLE_AUTHENTICATOR") - 1)) != NULL) {
727727
switch (Z_TYPE_P(disabled_auth_method)) {
728728
case IS_STRING:
729729
if (Z_STRLEN_P(disabled_auth_method) > 1) {

ext/imap/php_imap.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* @return resource|false
77
*/
8-
function imap_open(string $mailbox, string $user, string $password, int $options = 0, int $n_retries = 0, array $params = UNKNOWN) {}
8+
function imap_open(string $mailbox, string $user, string $password, int $options = 0, int $n_retries = 0, array $params = []) {}
99

1010
/**
1111
* @param resource $stream_id

ext/imap/php_imap_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: a1b1cb1bb36085cb43254b9d708585352d3cf72a */
2+
* Stub hash: fe7adff9478c5e0e2ad9df6f34dc8a862a537cb3 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_open, 0, 0, 3)
55
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
66
ZEND_ARG_TYPE_INFO(0, user, IS_STRING, 0)
77
ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0)
88
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_LONG, 0, "0")
99
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, n_retries, IS_LONG, 0, "0")
10-
ZEND_ARG_TYPE_INFO(0, params, IS_ARRAY, 0)
10+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, params, IS_ARRAY, 0, "[]")
1111
ZEND_END_ARG_INFO()
1212

1313
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_imap_reopen, 0, 2, _IS_BOOL, 0)

0 commit comments

Comments
 (0)