]> granicus.if.org Git - php/commitdiff
Convert the $ttl parameter of ldap_exop_refresh() to int
authorMáté Kocsis <kocsismate@woohoolabs.com>
Sun, 2 Aug 2020 22:38:59 +0000 (00:38 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Sun, 2 Aug 2020 22:38:59 +0000 (00:38 +0200)
ext/ldap/ldap.c
ext/ldap/ldap.stub.php

index 2983b857b62080a921a3321598b93bcd1fb52e08..cb0ab4f02c93de5aaa1512e33543e4fb7c76135f 100644 (file)
@@ -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 ) {
index b60d46a70b2b9d6bc3e13bdb932d063b529984f7..8a87fa501ffde307a66ebe689e14c68b177585f7 100644 (file)
@@ -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