mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02: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
2 changed files with 26 additions and 1 deletions
|
@ -619,7 +619,7 @@ PHP_FUNCTION(mysqli_change_user)
|
||||||
const CHARSET_INFO * old_charset;
|
const CHARSET_INFO * old_charset;
|
||||||
#endif
|
#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;
|
return;
|
||||||
}
|
}
|
||||||
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
|
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…
Add table
Add a link
Reference in a new issue