From 156c1806db952d6448b9807aa59ab0c515d241bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 3 Aug 2020 00:38:59 +0200 Subject: [PATCH] Convert the $ttl parameter of ldap_exop_refresh() to int --- ext/ldap/ldap.c | 7 ++++--- ext/ldap/ldap.stub.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) 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 -- 2.50.1