Changes from trunk/src/wp-includes/wp-db.php at r38133 to branches/4.6/src/wp-includes/wp-db.php at r38442
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6/src/wp-includes/wp-db.php
r38133 r38442 735 735 */ 736 736 public function init_charset() { 737 $charset = ''; 738 $collate = ''; 739 737 740 if ( function_exists('is_multisite') && is_multisite() ) { 738 741 $charset = 'utf8'; … … 809 812 $collate = $this->collate; 810 813 if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) { 814 $set_charset_succeeded = true; 815 811 816 if ( $this->use_mysqli ) { 812 817 if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) { 813 mysqli_set_charset( $dbh, $charset );818 $set_charset_succeeded = mysqli_set_charset( $dbh, $charset ); 814 819 } 815 $query = $this->prepare( 'SET NAMES %s', $charset ); 816 if ( ! empty( $collate ) ) 817 $query .= $this->prepare( ' COLLATE %s', $collate ); 818 mysqli_query( $dbh, $query ); 820 821 if ( $set_charset_succeeded ) { 822 $query = $this->prepare( 'SET NAMES %s', $charset ); 823 if ( ! empty( $collate ) ) 824 $query .= $this->prepare( ' COLLATE %s', $collate ); 825 mysqli_query( $dbh, $query ); 826 } 819 827 } else { 820 828 if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) { 821 mysql_set_charset( $charset, $dbh );829 $set_charset_succeeded = mysql_set_charset( $charset, $dbh ); 822 830 } 823 $query = $this->prepare( 'SET NAMES %s', $charset ); 824 if ( ! empty( $collate ) ) 825 $query .= $this->prepare( ' COLLATE %s', $collate ); 826 mysql_query( $query, $dbh ); 831 if ( $set_charset_succeeded ) { 832 $query = $this->prepare( 'SET NAMES %s', $charset ); 833 if ( ! empty( $collate ) ) 834 $query .= $this->prepare( ' COLLATE %s', $collate ); 835 mysql_query( $query, $dbh ); 836 } 827 837 } 828 838 }
Note: See TracChangeset
for help on using the changeset viewer.