From 561f1afe6ec3e1c551dba657a77ad948065c5e95 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 6 May 2017 15:06:34 +0200 Subject: [PATCH] Fixed bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types --- ext/mysqli/mysqli_api.c | 2 +- ext/mysqli/tests/bug74547.phpt | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 ext/mysqli/tests/bug74547.phpt diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 244ed945dee..ffdcdaf140a 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -619,7 +619,7 @@ PHP_FUNCTION(mysqli_change_user) const CHARSET_INFO * old_charset; #endif - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss!", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) { return; } MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); diff --git a/ext/mysqli/tests/bug74547.phpt b/ext/mysqli/tests/bug74547.phpt new file mode 100644 index 00000000000..a771c9a8524 --- /dev/null +++ b/ext/mysqli/tests/bug74547.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +bool(true) +===DONE===