diff options
author | Darek Slusarczyk <dariusz.slusarczyk@oracle.com> | 2019-02-11 18:18:57 +0100 |
---|---|---|
committer | Darek Slusarczyk <dariusz.slusarczyk@oracle.com> | 2019-02-11 18:18:57 +0100 |
commit | 6f7a47db5dc5a11333e131a071f20c0be19183a9 (patch) | |
tree | 0a238c5f00bdb62829c788fdf2c89ff13d9a3271 /ext/mysqli | |
parent | 4da67537c1bb5909e2f32c81534e316bff1af2f8 (diff) | |
parent | 83d2bc9b6df2f827217f1bc3298fb83cfe2ac210 (diff) | |
download | php-git-6f7a47db5dc5a11333e131a071f20c0be19183a9.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
Diffstat (limited to 'ext/mysqli')
-rw-r--r-- | ext/mysqli/mysqli.c | 4 | ||||
-rw-r--r-- | ext/mysqli/tests/061.phpt | 2 | ||||
-rw-r--r-- | ext/mysqli/tests/bug36745.phpt | 2 | ||||
-rw-r--r-- | ext/mysqli/tests/bug53503.phpt | 2 | ||||
-rw-r--r-- | ext/mysqli/tests/bug68077.phpt | 3 | ||||
-rw-r--r-- | ext/mysqli/tests/mysqli_constants.phpt | 2 | ||||
-rw-r--r-- | ext/mysqli/tests/mysqli_get_client_stats.phpt | 1 | ||||
-rw-r--r-- | ext/mysqli/tests/mysqli_info.phpt | 2 | ||||
-rw-r--r-- | ext/mysqli/tests/mysqli_local_infile_default_off.phpt | 26 | ||||
-rw-r--r-- | ext/mysqli/tests/mysqli_local_infile_set_on.phpt | 28 | ||||
-rw-r--r-- | ext/mysqli/tests/mysqli_real_connect.phpt | 2 | ||||
-rw-r--r-- | ext/mysqli/tests/mysqli_real_connect_pconn.phpt | 1 |
12 files changed, 73 insertions, 2 deletions
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index a25bc096ce..73511b2639 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -516,7 +516,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("mysqli.default_socket", NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_socket, zend_mysqli_globals, mysqli_globals) #endif STD_PHP_INI_BOOLEAN("mysqli.reconnect", "0", PHP_INI_SYSTEM, OnUpdateLong, reconnect, zend_mysqli_globals, mysqli_globals) - STD_PHP_INI_BOOLEAN("mysqli.allow_local_infile", "1", PHP_INI_SYSTEM, OnUpdateLong, allow_local_infile, zend_mysqli_globals, mysqli_globals) + STD_PHP_INI_BOOLEAN("mysqli.allow_local_infile", "0", PHP_INI_SYSTEM, OnUpdateLong, allow_local_infile, zend_mysqli_globals, mysqli_globals) PHP_INI_END() /* }}} */ @@ -541,7 +541,7 @@ static PHP_GINIT_FUNCTION(mysqli) mysqli_globals->reconnect = 0; mysqli_globals->report_mode = 0; mysqli_globals->report_ht = 0; - mysqli_globals->allow_local_infile = 1; + mysqli_globals->allow_local_infile = 0; #ifdef HAVE_EMBEDDED_MYSQLI mysqli_globals->embedded = 1; #else diff --git a/ext/mysqli/tests/061.phpt b/ext/mysqli/tests/061.phpt index 8c5b6aa23c..1f68a1fe6e 100644 --- a/ext/mysqli/tests/061.phpt +++ b/ext/mysqli/tests/061.phpt @@ -17,6 +17,8 @@ if ($msg = check_local_infile_support($link, $engine)) mysqli_close($link); ?> +--INI-- +mysqli.allow_local_infile=1 --FILE-- <?php require_once("connect.inc"); diff --git a/ext/mysqli/tests/bug36745.phpt b/ext/mysqli/tests/bug36745.phpt index 5e203e14eb..7a630afdc5 100644 --- a/ext/mysqli/tests/bug36745.phpt +++ b/ext/mysqli/tests/bug36745.phpt @@ -5,6 +5,8 @@ Bug #36745 (LOAD DATA LOCAL INFILE doesn't return correct error message) require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); ?> +--INI-- +mysqli.allow_local_infile=1 --FILE-- <?php require_once("connect.inc"); diff --git a/ext/mysqli/tests/bug53503.phpt b/ext/mysqli/tests/bug53503.phpt index bb8d00109f..fea62fde79 100644 --- a/ext/mysqli/tests/bug53503.phpt +++ b/ext/mysqli/tests/bug53503.phpt @@ -15,6 +15,8 @@ if ($msg = check_local_infile_support($link, $engine)) mysqli_close($link); ?> +--INI-- +mysqli.allow_local_infile=1 --FILE-- <?php require_once("connect.inc"); diff --git a/ext/mysqli/tests/bug68077.phpt b/ext/mysqli/tests/bug68077.phpt index f9fb962e77..639603aa50 100644 --- a/ext/mysqli/tests/bug68077.phpt +++ b/ext/mysqli/tests/bug68077.phpt @@ -17,6 +17,9 @@ if ($msg = check_local_infile_support($link, $engine)) mysqli_close($link); ?> --INI-- +mysqli.allow_local_infile=1 +mysqli.allow_persistent=1 +mysqli.max_persistent=1 open_basedir= --FILE-- <?php diff --git a/ext/mysqli/tests/mysqli_constants.phpt b/ext/mysqli/tests/mysqli_constants.phpt index 6f1cd5faa7..1994a5ec96 100644 --- a/ext/mysqli/tests/mysqli_constants.phpt +++ b/ext/mysqli/tests/mysqli_constants.phpt @@ -6,6 +6,8 @@ require_once('skipif.inc'); require_once('skipifemb.inc'); require_once('skipifconnectfailure.inc'); ?> +--INI-- +mysqli.allow_local_infile=1 --FILE-- <?php require("connect.inc"); diff --git a/ext/mysqli/tests/mysqli_get_client_stats.phpt b/ext/mysqli/tests/mysqli_get_client_stats.phpt index 29f8b430de..07ef78f296 100644 --- a/ext/mysqli/tests/mysqli_get_client_stats.phpt +++ b/ext/mysqli/tests/mysqli_get_client_stats.phpt @@ -12,6 +12,7 @@ if (!function_exists('mysqli_get_client_stats')) { --INI-- mysqlnd.collect_statistics=1 mysqlnd.collect_memory_statistics=1 +mysqli.allow_local_infile=1 --FILE-- <?php /* diff --git a/ext/mysqli/tests/mysqli_info.phpt b/ext/mysqli/tests/mysqli_info.phpt index 21851d6b30..56ee2cce05 100644 --- a/ext/mysqli/tests/mysqli_info.phpt +++ b/ext/mysqli/tests/mysqli_info.phpt @@ -6,6 +6,8 @@ require_once('skipif.inc'); require_once('skipifemb.inc'); require_once('skipifconnectfailure.inc'); ?> +--INI-- +mysqli.allow_local_infile=1 --FILE-- <?php require_once("connect.inc"); diff --git a/ext/mysqli/tests/mysqli_local_infile_default_off.phpt b/ext/mysqli/tests/mysqli_local_infile_default_off.phpt new file mode 100644 index 0000000000..c2e8aa2dc8 --- /dev/null +++ b/ext/mysqli/tests/mysqli_local_infile_default_off.phpt @@ -0,0 +1,26 @@ +--TEST-- +ensure default for local infile is off +--SKIPIF-- +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> +--FILE-- +<?php +require_once("connect.inc"); + +$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket); +$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"'); +$row = mysqli_fetch_assoc($res); +echo "server: ", $row['Value'], "\n"; +mysqli_free_result($res); +mysqli_close($link); + +echo "connector: ", ini_get("mysqli.allow_local_infile"), "\n"; + +print "done!\n"; +?> +--EXPECTF-- +server: %s +connector: 0 +done! diff --git a/ext/mysqli/tests/mysqli_local_infile_set_on.phpt b/ext/mysqli/tests/mysqli_local_infile_set_on.phpt new file mode 100644 index 0000000000..172d6dcb9b --- /dev/null +++ b/ext/mysqli/tests/mysqli_local_infile_set_on.phpt @@ -0,0 +1,28 @@ +--TEST-- +enable local infile +--SKIPIF-- +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> +--INI-- +mysqli.allow_local_infile=1 +--FILE-- +<?php +require_once("connect.inc"); + +$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket); +$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"'); +$row = mysqli_fetch_assoc($res); +echo "server: ", $row['Value'], "\n"; +mysqli_free_result($res); +mysqli_close($link); + +echo "connector: ", ini_get("mysqli.allow_local_infile"), "\n"; + +print "done!\n"; +?> +--EXPECTF-- +server: %s +connector: 1 +done! diff --git a/ext/mysqli/tests/mysqli_real_connect.phpt b/ext/mysqli/tests/mysqli_real_connect.phpt index dcc7ad5715..5e4b56173b 100644 --- a/ext/mysqli/tests/mysqli_real_connect.phpt +++ b/ext/mysqli/tests/mysqli_real_connect.phpt @@ -6,6 +6,8 @@ require_once('skipif.inc'); require_once('skipifemb.inc'); require_once('skipifconnectfailure.inc'); ?> +--INI-- +mysqli.allow_local_infile=1 --FILE-- <?php include("connect.inc"); diff --git a/ext/mysqli/tests/mysqli_real_connect_pconn.phpt b/ext/mysqli/tests/mysqli_real_connect_pconn.phpt index 4cc18198c6..0d1c4985f2 100644 --- a/ext/mysqli/tests/mysqli_real_connect_pconn.phpt +++ b/ext/mysqli/tests/mysqli_real_connect_pconn.phpt @@ -10,6 +10,7 @@ if (!$IS_MYSQLND) die("skip mysqlnd only test"); ?> --INI-- +mysqli.allow_local_infile=1 mysqli.allow_persistent=1 mysqli.max_persistent=10 --FILE-- |