-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #14804 - Undefined index: ssl_* variables
Fixes: #14804 Signed-off-by: William Desportes <williamdes@wdes.fr>
- Loading branch information
1 parent
b5b1488
commit 9a6a66b
Showing
1 changed file
with
20 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,13 +104,28 @@ public function connect( | |
! empty($server['ssl_ca_path']) || | ||
! empty($server['ssl_ciphers']) | ||
) { | ||
if (! isset($server['ssl_key']) || is_null($server['ssl_key'])) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
williamdes
Author
Member
|
||
$server['ssl_key'] = ''; | ||
} | ||
if (! isset($server['ssl_cert']) || is_null($server['ssl_cert'])) { | ||
$server['ssl_cert'] = ''; | ||
} | ||
if (! isset($server['ssl_ca']) || is_null($server['ssl_ca'])) { | ||
$server['ssl_ca'] = ''; | ||
} | ||
if (! isset($server['ssl_ca_path']) || is_null($server['ssl_ca_path'])) { | ||
$server['ssl_ca_path'] = ''; | ||
} | ||
if (! isset($server['ssl_ciphers']) || is_null($server['ssl_ciphers'])) { | ||
$server['ssl_ciphers'] = ''; | ||
} | ||
mysqli_ssl_set( | ||
$link, | ||
is_null($server['ssl_key']) ? '' : $server['ssl_key'], | ||
is_null($server['ssl_cert']) ? '' : $server['ssl_cert'], | ||
is_null($server['ssl_ca']) ? '' : $server['ssl_ca'], | ||
is_null($server['ssl_ca_path']) ? '' : $server['ssl_ca_path'], | ||
is_null($server['ssl_ciphers']) ? '' : $server['ssl_ciphers'] | ||
$server['ssl_key'], | ||
$server['ssl_cert'], | ||
$server['ssl_ca'], | ||
$server['ssl_ca_path'], | ||
$server['ssl_ciphers'] | ||
); | ||
} | ||
/* | ||
|
I was about to comment on eb52589 but then seen the commit here. :)
https://3v4l.org/f9ONn
I don't think the
is_null()
is required.isset()
returnsFALSE
if either the key is not set, or if the key is set but its value isNULL
- https://www.php.net/manual/en/function.isset.php.