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

git-svn-id: http://svn.automattic.com/wordpress/trunk@6459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-12-21 19:30:08 +00:00
parent 40a7118dd5
commit 9563ccece0

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') )