mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-12 13:44:21 +01:00
Specify collation as well when connecting to the database if it is provided. See #6410 for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@7579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6e9a44bd99
commit
74a7fc7923
@ -84,8 +84,18 @@ class wpdb {
|
|||||||
|
|
||||||
$this->ready = true;
|
$this->ready = true;
|
||||||
|
|
||||||
if ( !empty($this->charset) && version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') )
|
if ( $this->supports_collation() ) {
|
||||||
$this->query("SET NAMES '$this->charset'");
|
$collation_query = '';
|
||||||
|
if ( !empty($this->charset) ) {
|
||||||
|
$collation_query = "SET NAMES '{$this->charset}'";
|
||||||
|
if (!empty($this->collate) )
|
||||||
|
$collation_query .= " COLLATE '{$this->collate}'";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !empty($collation_query) )
|
||||||
|
$this->query($collation_query);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$this->select($dbname);
|
$this->select($dbname);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user