From: Máté Kocsis Date: Sun, 2 Aug 2020 22:38:59 +0000 (+0200) Subject: Convert the $ttl parameter of ldap_exop_refresh() to int X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=156c1806db952d6448b9807aa59ab0c515d241bc;p=php Convert the $ttl parameter of ldap_exop_refresh() to int --- diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 2983b857b6..cb0ab4f02c 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -4314,14 +4314,15 @@ PHP_FUNCTION(ldap_exop_whoami) /* {{{ DDS refresh extended operation */ PHP_FUNCTION(ldap_exop_refresh) { - zval *link, *ttl; + zval *link; + zend_long ttl; struct berval ldn; ber_int_t lttl; ber_int_t newttl; ldap_linkdata *ld; int rc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsz", &link, &ldn.bv_val, &ldn.bv_len, &ttl) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsl", &link, &ldn.bv_val, &ldn.bv_len, &ttl) != SUCCESS) { RETURN_THROWS(); } @@ -4329,7 +4330,7 @@ PHP_FUNCTION(ldap_exop_refresh) RETURN_THROWS(); } - lttl = (ber_int_t)zval_get_long(ttl); + lttl = (ber_int_t) ttl; rc = ldap_refresh_s(ld->link, &ldn, lttl, &newttl, NULL, NULL); if (rc != LDAP_SUCCESS ) { diff --git a/ext/ldap/ldap.stub.php b/ext/ldap/ldap.stub.php index b60d46a70b..8a87fa501f 100644 --- a/ext/ldap/ldap.stub.php +++ b/ext/ldap/ldap.stub.php @@ -305,7 +305,7 @@ function ldap_exop_whoami($link): string|bool {} #ifdef HAVE_LDAP_REFRESH_S /** @param resource $link */ -function ldap_exop_refresh($link, string $dn, $ttl): int|false {} +function ldap_exop_refresh($link, string $dn, int $ttl): int|false {} #endif