diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-08-01 14:03:26 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-08-01 14:03:26 +0000 |
| commit | f8dbb829a0a85ba6d457316ff80ebf77328c9b72 (patch) | |
| tree | 0864d8b47b5fd1dd06f66dd8591b90979b5a5c2c /wp-inst/wp-includes/wp-db.php | |
| parent | ffc390ed27bdbac99bdc586cff0a27c7e0120a6e (diff) | |
Select query type fix.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@114 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/wp-db.php')
| -rw-r--r-- | wp-inst/wp-includes/wp-db.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/wp-inst/wp-includes/wp-db.php b/wp-inst/wp-includes/wp-db.php index 29f575d..3f2ce6e 100644 --- a/wp-inst/wp-includes/wp-db.php +++ b/wp-inst/wp-includes/wp-db.php @@ -132,11 +132,11 @@ class wpdb { } function db_connect( $query = "SELECT" ) { - global $db_list; + global $db_list, $global_db_list; if( is_array( $db_list ) == false ) return true; - if ( preg_match("/^\\s*(" . $wpdb->blogs . "|" . $wpdb->users . "|" . $wpdb->usermeta . "|" . $wpdb->site . "|" . $wpdb->sitemeta . "|" . $wpdb->sitecategories . ") /i",$query) ) { + if( $this->blogs != '' && preg_match("/(" . $this->blogs . "|" . $this->users . "|" . $this->usermeta . "|" . $this->site . "|" . $this->sitemeta . "|" . $this->sitecategories . ")/i",$query) ) { $action = 'global'; $details = $global_db_list[ mt_rand( 0, count( $global_db_list ) -1 ) ]; } elseif ( preg_match("/^\\s*(insert|delete|update|replace) /i",$query) ) { @@ -185,7 +185,7 @@ class wpdb { // use $this->dbh for read ops, and $this->dbhwrite for write ops // use $this->dbhglobal for gloal table ops if( defined( "WP_USE_MULTIPLE_DB" ) && CONSTANT( "WP_USE_MULTIPLE_DB" ) == true ) { - if ( preg_match("/^\\s*(" . $wpdb->blogs . "|" . $wpdb->users . "|" . $wpdb->usermeta . "|" . $wpdb->site . "|" . $wpdb->sitemeta . "|" . $wpdb->sitecategories . ") /i",$query) ) { + if( $this->blogs != '' && preg_match("/(" . $this->blogs . "|" . $this->users . "|" . $this->usermeta . "|" . $this->site . "|" . $this->sitemeta . "|" . $this->sitecategories . ")/i",$query) ) { $this->db_connect( $query ); $dbh =& $this->dbhglobal; } elseif ( preg_match("/^\\s*(insert|delete|update|replace) /i",$query) ) { |
