Changeset 38442
- Timestamp:
- 08/30/2016 07:41:11 AM (8 years ago)
- Location:
- branches/4.6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.6
-
branches/4.6/src/wp-includes/wp-db.php
r38440 r38442 812 812 $collate = $this->collate; 813 813 if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) { 814 $set_charset_succeeded = true; 815 814 816 if ( $this->use_mysqli ) { 815 817 if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) { 816 mysqli_set_charset( $dbh, $charset );818 $set_charset_succeeded = mysqli_set_charset( $dbh, $charset ); 817 819 } 818 $query = $this->prepare( 'SET NAMES %s', $charset ); 819 if ( ! empty( $collate ) ) 820 $query .= $this->prepare( ' COLLATE %s', $collate ); 821 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 } 822 827 } else { 823 828 if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) { 824 mysql_set_charset( $charset, $dbh );829 $set_charset_succeeded = mysql_set_charset( $charset, $dbh ); 825 830 } 826 $query = $this->prepare( 'SET NAMES %s', $charset ); 827 if ( ! empty( $collate ) ) 828 $query .= $this->prepare( ' COLLATE %s', $collate ); 829 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 } 830 837 } 831 838 }
Note: See TracChangeset
for help on using the changeset viewer.