Fixed potential infinite loop if there are no posts

git-svn-id: http://svn.automattic.com/wordpress/trunk@425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
emc3 2003-10-07 18:19:47 +00:00
parent f742df8065
commit b6fd4cc8d4
1 changed files with 5 additions and 0 deletions

View File

@ -56,6 +56,11 @@ require_once($abspath.$b2inc.'/b2template.functions.php');
require_once($abspath.$b2inc.'/b2functions.php');
require_once($abspath.$b2inc.'/b2vars.php');
// Quick check. If we have no posts at all, abort!
$gotsome = $wpdb->get_var("SELECT ID from $tableposts WHERE post_status = 'publish' AND post_category > 0 ORDER BY post_date DESC LIMIT 1");
if (!$gotsome)
return;
$w = $HTTP_GET_VARS['w'];
if (isset($HTTP_GET_VARS['w'])) {
$w = $HTTP_GET_VARS['w'];