mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
Merge branch 'PHP-7.1'
* PHP-7.1: Fixed bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types
This commit is contained in:
commit
703209f146
@ -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);
|
||||
|
25
ext/mysqli/tests/bug74547.phpt
Normal file
25
ext/mysqli/tests/bug74547.phpt
Normal file
@ -0,0 +1,25 @@
|
||||
--TEST--
|
||||
Bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
require_once('skipifconnectfailure.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once("connect.inc");
|
||||
|
||||
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
|
||||
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
|
||||
$host, $user, $db, $port, $socket);
|
||||
|
||||
var_dump(mysqli_change_user($link, $user, $passwd, NULL));
|
||||
|
||||
mysqli_close($link);
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
===DONE===
|
Loading…
Reference in New Issue
Block a user