WordPress.org

Make WordPress Core

Changeset 7579


Ignore:
Timestamp:
03/30/2008 05:56:27 PM (10 years ago)
Author:
westi
Message:

Specify collation as well when connecting to the database if it is provided. See #6410 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r7431 r7579  
    8585        $this->ready = true;
    8686
    87         if ( !empty($this->charset) && version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') )
    88             $this->query("SET NAMES '$this->charset'");
    89 
     87        if ( $this->supports_collation() ) {
     88            $collation_query = '';
     89            if ( !empty($this->charset) ) {
     90                $collation_query = "SET NAMES '{$this->charset}'";
     91                if (!empty($this->collate) )
     92                    $collation_query .= " COLLATE '{$this->collate}'";
     93            }
     94           
     95            if ( !empty($collation_query) )
     96                $this->query($collation_query);
     97           
     98        }
     99       
    90100        $this->select($dbname);
    91101    }
Note: See TracChangeset for help on using the changeset viewer.