summaryrefslogtreecommitdiffstats
path: root/lib/mysql.php
diff options
context:
space:
mode:
authorGordon Franke <gordon.franke@sap.com>2016-02-02 12:06:49 +0100
committerGordon Franke <gordon.franke@sap.com>2016-02-03 07:54:02 +0100
commitcb3cce2392a9022cc8493a93c76a113ebbb764e8 (patch)
tree5e8ad48ab48b3d940e2e17c513d58b83a7e079a8 /lib/mysql.php
parent44377a665aad2777e0c3c82a6a1e674eeb56eb80 (diff)
downloadphp7-mysql-shim-cb3cce2392a9022cc8493a93c76a113ebbb764e8.zip
php7-mysql-shim-cb3cce2392a9022cc8493a93c76a113ebbb764e8.tar.gz
php7-mysql-shim-cb3cce2392a9022cc8493a93c76a113ebbb764e8.tar.bz2
add unit test for mysqli defaults
Diffstat (limited to 'lib/mysql.php')
-rw-r--r--lib/mysql.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/mysql.php b/lib/mysql.php
index 01fe58e..e587c2a 100644
--- a/lib/mysql.php
+++ b/lib/mysql.php
@@ -20,14 +20,14 @@ namespace {
if ($new !== false) {
trigger_error('Argument $new is no longer supported in PHP > 7', E_USER_WARNING);
}
- if (!$hostname) {
- $hostname = ini_get("mysqli.default_host");
+ if (null === $hostname) {
+ $hostname = ini_get('mysqli.default_host') ?: null;
}
- if (!$username) {
- $username = ini_get("mysqli.default_user");
+ if (null === $username) {
+ $username = ini_get('mysqli.default_user') ?: null;
}
- if (!$password) {
- $password = ini_get("mysqli.default_pw");
+ if (null === $password) {
+ $password = ini_get('mysqli.default_pw') ?: null;
}
$hash = sha1($hostname . $username . $flags);