Changeset 12753 for trunk/wp-includes/wp-db.php
- Timestamp:
- 01/18/2010 10:21:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/wp-db.php
r12733 r12753 371 371 $this->show_errors(); 372 372 373 if( is_multisite() ) { 374 $this->charset = 'utf8'; 375 if( defined( 'DB_COLLATE' ) && constant( 'DB_COLLATE' ) != '' ) { 376 $this->collate = constant( 'DB_COLLATE' ); 377 } else { 378 $this->collate = 'utf8_general_ci'; 379 } 380 } 373 if ( is_multisite() ) { 374 $this->charset = 'utf8'; 375 if ( defined( 'DB_COLLATE' ) && constant( 'DB_COLLATE' ) != '' ) 376 $this->collate = constant( 'DB_COLLATE' ); 377 else 378 $this->collate = 'utf8_general_ci'; 379 } 381 380 382 381 if ( defined('DB_CHARSET') ) … … 447 446 return new WP_Error('invalid_db_prefix', /*WP_I18N_DB_BAD_PREFIX*/'Invalid database prefix'/*/WP_I18N_DB_BAD_PREFIX*/); 448 447 449 if( is_multisite() ) { 450 451 } else { 452 453 } 454 if ( isset( $this->base_prefix ) )448 if ( is_multisite() ) 449 $old_prefix = ''; 450 else 451 $old_prefix = $prefix; 452 453 if ( isset( $this->base_prefix ) ) 455 454 $old_prefix = $this->base_prefix; 456 455 $this->base_prefix = $prefix; … … 665 664 return false; 666 665 667 668 if( is_multisite() ) {669 670 if( defined( 'ERRORLOGFILE' ) )671 672 if( defined( 'DIEONDBERROR' ) )673 674 675 676 677 678 679 680 681 682 666 // If there is an error then take note of it 667 if ( is_multisite() ) { 668 $msg = "WordPress database error: [$str]\n{$this->last_query}\n"; 669 if ( defined( 'ERRORLOGFILE' ) ) 670 error_log( $msg, 3, CONSTANT( 'ERRORLOGFILE' ) ); 671 if ( defined( 'DIEONDBERROR' ) ) 672 die( $msg ); 673 } else { 674 $str = htmlspecialchars($str, ENT_QUOTES); 675 $query = htmlspecialchars($this->last_query, ENT_QUOTES); 676 677 print "<div id='error'> 678 <p class='wpdberror'><strong>WordPress database error:</strong> [$str]<br /> 679 <code>$query</code></p> 680 </div>"; 681 } 683 682 } 684 683 … … 740 739 function db_connect( $query = "SELECT" ) { 741 740 global $db_list, $global_db_list; 742 if ( is_array( $db_list ) == false )741 if ( is_array( $db_list ) == false ) 743 742 return true; 744 743 745 if ( $this->blogs != '' && preg_match("/(" . $this->blogs . "|" . $this->users . "|" . $this->usermeta . "|" . $this->site . "|" . $this->sitemeta . "|" . $this->sitecategories . ")/i",$query) ) {744 if ( $this->blogs != '' && preg_match("/(" . $this->blogs . "|" . $this->users . "|" . $this->usermeta . "|" . $this->site . "|" . $this->sitemeta . "|" . $this->sitecategories . ")/i",$query) ) { 746 745 $action = 'global'; 747 746 $details = $global_db_list[ mt_rand( 0, count( $global_db_list ) -1 ) ];
Note: See TracChangeset
for help on using the changeset viewer.