From a1310144a681b086699f848830f0dbb848101c61 Mon Sep 17 00:00:00 2001
From: Paul Biron <paul@sparrowhawkcomputing.com>
Date: Sat, 30 Jan 2021 09:53:25 -0700
Subject: [PATCH] Update patch so it applies cleanly now.
---
src/wp-includes/wp-db.php | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php
index 2ec3312c46..8b70e90efd 100644
|
a
|
b
|
class wpdb { |
| 1649 | 1649 | $host = "[$host]"; |
| 1650 | 1650 | } |
| 1651 | 1651 | |
| | 1652 | // call set_ssl if mysql client flag set. |
| | 1653 | if ( $client_flags & MYSQL_CLIENT_SSL ) { |
| | 1654 | $pack = array( $this->dbh ); |
| | 1655 | $call_set = false; |
| | 1656 | foreach( array( 'MYSQL_SSL_KEY', 'MYSQL_SSL_CERT', 'MYSQL_SSL_CA', 'MYSQL_SSL_CAPATH', 'MYSQL_SSL_CIPHER' ) as $opt_key ) { |
| | 1657 | $pack[] = ( defined( $opt_key ) ) ? constant( $opt_key ) : null; |
| | 1658 | $call_set |= defined( $opt_key ); |
| | 1659 | } |
| | 1660 | |
| | 1661 | /* |
| | 1662 | * Now if anything was packed - unpack into the function. |
| | 1663 | * Note this doesn't check if paths exist, as per the PHP doc |
| | 1664 | * at http://www.php.net/manual/en/mysqli.ssl-set.php: "This |
| | 1665 | * function always returns TRUE value. If SSL setup is incorrect |
| | 1666 | * mysqli_real_connect() will return an error ...". |
| | 1667 | */ |
| | 1668 | if ( $call_set ) { // SSL added here! |
| | 1669 | call_user_func_array( 'mysqli_ssl_set', $pack ); |
| | 1670 | } |
| | 1671 | } |
| | 1672 | |
| 1652 | 1673 | if ( WP_DEBUG ) { |
| 1653 | 1674 | mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags ); |
| 1654 | 1675 | } else { |