Avoid a warning in wpdb::db_connect(). before_needle parameter of strstr() was added in PHP 5.3.

props klihelp, pento.
fixes #27277.

git-svn-id: https://develop.svn.wordpress.org/trunk@27503 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2014-03-11 19:26:02 +00:00
parent 1a769c0e11
commit 28dd458547
1 changed files with 1 additions and 1 deletions

View File

@ -1315,7 +1315,7 @@ class wpdb {
$host = $this->dbhost; $host = $this->dbhost;
$port_or_socket = strstr( $host, ':' ); $port_or_socket = strstr( $host, ':' );
if ( ! empty( $port_or_socket ) ) { if ( ! empty( $port_or_socket ) ) {
$host = strstr( $host, ':', true ); $host = substr( $host, 0, strpos( $host, ':' ) );
$port_or_socket = substr( $port_or_socket, 1 ); $port_or_socket = substr( $port_or_socket, 1 );
if ( 0 !== strpos( $port_or_socket, '/' ) ) { if ( 0 !== strpos( $port_or_socket, '/' ) ) {
$port = intval( $port_or_socket ); $port = intval( $port_or_socket );