Ticket #37689: 37689.diff
File 37689.diff, 1.6 KB (added by , 9 years ago) |
---|
-
src/wp-includes/wp-db.php
808 808 if ( ! isset( $collate ) ) 809 809 $collate = $this->collate; 810 810 if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) { 811 $set_charset_succeeded = true; 812 811 813 if ( $this->use_mysqli ) { 812 814 if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) { 813 mysqli_set_charset( $dbh, $charset ); 815 $set_charset_succeeded = mysqli_set_charset( $dbh, $charset ); 816 } 817 818 if ( $set_charset_succeeded ) { 819 $query = $this->prepare( 'SET NAMES %s', $charset ); 820 if ( ! empty( $collate ) ) 821 $query .= $this->prepare( ' COLLATE %s', $collate ); 822 mysqli_query( $dbh, $query ); 814 823 } 815 $query = $this->prepare( 'SET NAMES %s', $charset );816 if ( ! empty( $collate ) )817 $query .= $this->prepare( ' COLLATE %s', $collate );818 mysqli_query( $dbh, $query );819 824 } else { 820 825 if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) { 821 mysql_set_charset( $charset, $dbh ); 826 $set_charset_succeeded = mysql_set_charset( $charset, $dbh ); 827 } 828 if ( $set_charset_succeeded ) { 829 $query = $this->prepare( 'SET NAMES %s', $charset ); 830 if ( ! empty( $collate ) ) 831 $query .= $this->prepare( ' COLLATE %s', $collate ); 832 mysql_query( $query, $dbh ); 822 833 } 823 $query = $this->prepare( 'SET NAMES %s', $charset );824 if ( ! empty( $collate ) )825 $query .= $this->prepare( ' COLLATE %s', $collate );826 mysql_query( $query, $dbh );827 834 } 828 835 } 829 836 }