Ticket #24210: 24210.wpdb.patch
File 24210.wpdb.patch, 1.9 KB (added by , 12 years ago) |
---|
-
wp-includes/wp-db.php
640 640 * @param string $charset The character set (optional) 641 641 * @param string $collate The collation (optional) 642 642 */ 643 function set_charset( $dbh, $charset = null, $collate = null) {644 if ( ! isset($charset) )643 function set_charset( $dbh, $charset = null, $collate = null ) { 644 if ( ! isset( $charset ) ) 645 645 $charset = $this->charset; 646 if ( ! isset($collate) )646 if ( ! isset( $collate ) ) 647 647 $collate = $this->collate; 648 if ( $this->has_cap( 'collation' , $dbh ) && !empty( $charset ) ) {649 if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' , $dbh) ) {648 if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) { 649 if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) { 650 650 mysql_set_charset( $charset, $dbh ); 651 651 $this->real_escape = true; 652 652 } else { … … 1687 1687 } 1688 1688 1689 1689 /** 1690 * Determine if a database supports a particular feature 1690 * Determine if a database supports a particular feature. 1691 1691 * 1692 1692 * @since 2.7.0 1693 * @see 1693 * @see wpdb::db_version() 1694 1694 * 1695 * @param string $db_cap the feature1695 * @param string $db_cap The feature to check for. 1696 1696 * @return bool 1697 1697 */ 1698 1698 function has_cap( $db_cap ) { … … 1700 1700 1701 1701 switch ( strtolower( $db_cap ) ) { 1702 1702 case 'collation' : // @since 2.5.0 1703 case 'group_concat' : // @since 2.7 1704 case 'subqueries' : // @since 2.7 1703 case 'group_concat' : // @since 2.7.0 1704 case 'subqueries' : // @since 2.7.0 1705 1705 return version_compare( $version, '4.1', '>=' ); 1706 1706 case 'set_charset' : 1707 return version_compare( $version, '5.0.7', '>=');1707 return version_compare( $version, '5.0.7', '>=' ); 1708 1708 }; 1709 1709 1710 1710 return false;