Changeset 41820
- Timestamp:
- 10/11/2017 12:09:47 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r41789 r41820 1480 1480 $socket = null; 1481 1481 $is_ipv6 = false; 1482 1482 1483 1483 if ( $host_data = $this->parse_db_host( $this->dbhost ) ) { 1484 1484 list( $host, $port, $socket, $is_ipv6 ) = $host_data; … … 1622 1622 } 1623 1623 1624 $host = ''; 1624 1625 foreach ( array( 'host', 'port', 'socket' ) as $component ) { 1625 if ( array_key_exists( $component, $matches) ) {1626 $$component = $matches[ $component];1626 if ( ! empty( $matches[ $component ] ) ) { 1627 $$component = $matches[ $component ]; 1627 1628 } 1628 1629 } -
trunk/tests/phpunit/tests/db.php
r41662 r41820 1209 1209 list( $parsed_host, $parsed_port, $parsed_socket, $parsed_is_ipv6 ) = $data; 1210 1210 1211 $this->assert Equals( $host, $parsed_host );1212 $this->assert Equals( $port, $parsed_port );1213 $this->assert Equals( $socket, $parsed_socket );1214 $this->assert Equals( $is_ipv6, $parsed_is_ipv6 );1211 $this->assertSame( $host, $parsed_host ); 1212 $this->assertSame( $port, $parsed_port ); 1213 $this->assertSame( $socket, $parsed_socket ); 1214 $this->assertSame( $is_ipv6, $parsed_is_ipv6 ); 1215 1215 } 1216 1216 } … … 1221 1221 '', // DB_HOST 1222 1222 false, // Expect parse_db_host to bail for this hostname 1223 null,// Parsed host1223 '', // Parsed host 1224 1224 null, // Parsed port 1225 1225 null, // Parsed socket … … 1229 1229 ':3306', 1230 1230 false, 1231 null,1231 '', 1232 1232 '3306', 1233 1233 null, … … 1237 1237 ':/tmp/mysql.sock', 1238 1238 false, 1239 null,1239 '', 1240 1240 null, 1241 1241 '/tmp/mysql.sock',
Note: See TracChangeset
for help on using the changeset viewer.