mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00: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. git-svn-id: https://develop.svn.wordpress.org/trunk@53670 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user