Changeset 53670
- Timestamp:
- 07/06/2022 05:31:47 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r53584 r53670 2077 2077 } 2078 2078 } 2079 2080 // MySQLi port cannot be a string; must be null or an integer. 2081 $port = $port ? absint( $port ) : null; 2079 2082 2080 2083 return array( $host, $port, $socket, $is_ipv6 ); -
trunk/tests/phpunit/tests/db.php
r53577 r53670 1971 1971 * @dataProvider parse_db_host_data_provider 1972 1972 * @ticket 41722 1973 * @ticket 54877 1973 1974 */ 1974 1975 public function test_parse_db_host( $host_string, $expect_bail, $host, $port, $socket, $is_ipv6 ) { … … 2003 2004 false, 2004 2005 '', 2005 '3306',2006 3306, 2006 2007 null, 2007 2008 false, … … 2032 2033 ), 2033 2034 array( 2035 '127.0.0.1:port_as_string', 2036 false, 2037 '127.0.0.1', 2038 null, 2039 null, 2040 false, 2041 ), 2042 array( 2034 2043 '127.0.0.1:3306', 2035 2044 false, 2036 2045 '127.0.0.1', 2037 '3306',2046 3306, 2038 2047 null, 2039 2048 false, … … 2043 2052 false, 2044 2053 '127.0.0.1', 2045 '3306',2054 3306, 2046 2055 '/tmp/mysql:with_colon.sock', 2047 2056 false, … … 2056 2065 ), 2057 2066 array( 2067 'example.com:port_as_string', 2068 false, 2069 'example.com', 2070 null, 2071 null, 2072 false, 2073 ), 2074 array( 2058 2075 'example.com:3306', 2059 2076 false, 2060 2077 'example.com', 2061 '3306',2078 3306, 2062 2079 null, 2063 2080 false, … … 2072 2089 ), 2073 2090 array( 2091 'localhost:port_as_string', 2092 false, 2093 'localhost', 2094 null, 2095 null, 2096 false, 2097 ), 2098 array( 2074 2099 'localhost:/tmp/mysql.sock', 2075 2100 false, … … 2088 2113 ), 2089 2114 array( 2115 'localhost:port_as_string:/tmp/mysql:with_colon.sock', 2116 false, 2117 'localhost', 2118 null, 2119 '/tmp/mysql:with_colon.sock', 2120 false, 2121 ), 2122 array( 2090 2123 '0000:0000:0000:0000:0000:0000:0000:0001', 2091 2124 false, … … 2115 2148 false, 2116 2149 '::1', 2117 '3306',2150 3306, 2118 2151 null, 2119 2152 true, 2120 2153 ), 2121 2154 array( 2155 '[::1]:port_as_string', 2156 false, 2157 '::1', 2158 null, 2159 null, 2160 true, 2161 ), 2162 array( 2122 2163 '[::1]:3306:/tmp/mysql:with_colon.sock', 2123 2164 false, 2124 2165 '::1', 2125 '3306',2166 3306, 2126 2167 '/tmp/mysql:with_colon.sock', 2127 2168 true,
Note: See TracChangeset
for help on using the changeset viewer.