Make dbh parameter to select optional for plugin back compat. Don't pass by ref to preserve PHP 4 support. fixes #13914

git-svn-id: https://develop.svn.wordpress.org/trunk@15266 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-06-16 19:28:01 +00:00
parent 7def07393e
commit dbbc8adb90
1 changed files with 5 additions and 1 deletions

View File

@ -733,9 +733,13 @@ class wpdb {
* @since 0.71
*
* @param string $db MySQL database name
* @param resource $dbh Optional link identifier.
* @return null Always null.
*/
function select( $db, &$dbh ) {
function select( $db, $dbh = null) {
if ( is_null($dbh) )
$dbh = $this->dbh;
if ( !@mysql_select_db( $db, $dbh ) ) {
$this->ready = false;
$this->bail( sprintf( /*WP_I18N_DB_SELECT_DB*/'