From 87fad8cdf0b978bb7dca5123cb77efd1449c0132 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 11 Nov 2019 09:58:10 +0100 Subject: [PATCH] Fix #78790: mysqli_get_client_info() expects exactly 0 parameters `mysqli_get_client_info()` and `mysqli_thread_safe()` can also be called as methods, so we have to cater to this when parsing the arguments. --- ext/mysqli/mysqli_api.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index aac3134a59..e51c0cc741 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1374,7 +1374,9 @@ PHP_FUNCTION(mysqli_free_result) Get MySQL client info */ PHP_FUNCTION(mysqli_get_client_info) { - if (zend_parse_parameters_none() == FAILURE) { + zval *mysql_link; + + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { return; } @@ -2631,7 +2633,9 @@ PHP_FUNCTION(mysqli_thread_id) Return whether thread safety is given or not */ PHP_FUNCTION(mysqli_thread_safe) { - if (zend_parse_parameters_none() == FAILURE) { + zval *mysql_link; + + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) { return; } -- 2.50.1