Return after bailing since bail doesn't always die now. Don't do queries if constructor didn't complete. see #5495

git-svn-id: https://develop.svn.wordpress.org/trunk@6459 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2007-12-21 19:30:08 +00:00
parent 0c135204a3
commit 9365777088
1 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,7 @@ class wpdb {
var $col_info;
var $queries;
var $prefix = '';
var $ready = false;
// Our tables
var $posts;
@ -72,12 +73,14 @@ class wpdb {
</ul>
<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>
");
return;
}
if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') )
$this->query("SET NAMES '$this->charset'");
$this->select($dbname);
$this->ready = true;
}
function __destruct() {
@ -119,6 +122,7 @@ class wpdb {
<li>On some systems the name of your database is prefixed with your username, so it would be like username_wordpress. Could that be the problem?</li>
</ul>
<p>If you don't know how to setup a database you should <strong>contact your host</strong>. If all else fails you may find help at the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>");
return;
}
}
@ -218,6 +222,9 @@ class wpdb {
// Basic Query - see docs for more detail
function query($query) {
if ( ! $ready )
return false;
// filter the query, if filters are available
// NOTE: some queries are made before the plugins have been loaded, and thus cannot be filtered with this method
if ( function_exists('apply_filters') )