mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
Database: Ensure MySQL port numbers are numeric in wpdb
.
Ensure the database port number is recorded as an integer or `null` (the default port) when parsing the database host. This is to prevent PHP/MySQLi throwing an exception caused by ports represented as numeric strings. Props audrasjb, azouamauriac, chaion07, costdev, johnjamesjacoby, jrf, sergeybiryukov. Fixes #54877. Built from https://develop.svn.wordpress.org/trunk@53670 git-svn-id: http://core.svn.wordpress.org/trunk@53229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1ace1a4d2b
commit
d7d9adbf02
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.1-alpha-53669';
|
$wp_version = '6.1-alpha-53670';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
@ -2077,6 +2077,9 @@ class wpdb {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MySQLi port cannot be a string; must be null or an integer.
|
||||||
|
$port = $port ? absint( $port ) : null;
|
||||||
|
|
||||||
return array( $host, $port, $socket, $is_ipv6 );
|
return array( $host, $port, $socket, $is_ipv6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user