diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-12-30 16:18:46 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-12-30 17:40:16 +0100 |
commit | 55fd97c576f2d0f2a6e964d14b913b7ea2d88caa (patch) | |
tree | 2a61f845b93c11cef2135920d483210d456dab67 /ext/mysqli/mysqli_api.c | |
parent | e1b57310b1ec15b24e5ead8b63e58f74a0dbc988 (diff) | |
download | php-git-55fd97c576f2d0f2a6e964d14b913b7ea2d88caa.tar.gz |
Fix #78790: mysqli_get_client_info() expects exactly 0 parameters, 1 given
Although the `mysqli` parameter is unused, it had been accepted so far,
and the documentation even claims that parameter would be required. To
not break BC, we allow it again.
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r-- | ext/mysqli/mysqli_api.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index aac3134a59..206b00dfb6 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1374,8 +1374,16 @@ PHP_FUNCTION(mysqli_free_result) Get MySQL client info */ PHP_FUNCTION(mysqli_get_client_info) { - if (zend_parse_parameters_none() == FAILURE) { - return; + if (getThis()) { + if (zend_parse_parameters_none() == FAILURE) { + return; + } + } else { + zval *mysql_link; + + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|O", &mysql_link, mysqli_link_class_entry) == FAILURE) { + return; + } } const char * info = mysql_get_client_info(); |