From 28dd4585474a30b19cffcaa1ed01b6b6d7f189f6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 11 Mar 2014 19:26:02 +0000 Subject: [PATCH] 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 --- src/wp-includes/wp-db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index b57d572fdd..170c29565e 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -1315,7 +1315,7 @@ class wpdb { $host = $this->dbhost; $port_or_socket = strstr( $host, ':' ); if ( ! empty( $port_or_socket ) ) { - $host = strstr( $host, ':', true ); + $host = substr( $host, 0, strpos( $host, ':' ) ); $port_or_socket = substr( $port_or_socket, 1 ); if ( 0 !== strpos( $port_or_socket, '/' ) ) { $port = intval( $port_or_socket );