Skip to content

Commit 7e06628

Browse files
committed
Don't block SET NAMES query. Props g30rg3x for the find. fixes WordPress#5503 for 2.4
git-svn-id: https://develop.svn.wordpress.org/trunk@6464 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c8e824c commit 7e06628

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

wp-includes/wp-db.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@ function __construct($dbuser, $dbpassword, $dbname, $dbhost) {
7676
return;
7777
}
7878

79+
$this->ready = true;
80+
7981
if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') )
8082
$this->query("SET NAMES '$this->charset'");
8183

8284
$this->select($dbname);
83-
$this->ready = true;
8485
}
8586

8687
function __destruct() {
@@ -113,6 +114,7 @@ function set_prefix($prefix) {
113114
*/
114115
function select($db) {
115116
if (!@mysql_select_db($db, $this->dbh)) {
117+
$this->ready = false;
116118
$this->bail("
117119
<h1>Can&#8217;t select database</h1>
118120
<p>We were able to connect to the database server (which means your username and password is okay) but not able to select the <code>$db</code> database.</p>

0 commit comments

Comments
 (0)